ReactJ不在iOS上加载
我的React Web应用程序没有在iOS上加载,尤其是v15.5。
当我使用iPhone或iPad访问网站时,仅加载黑页。
有没有办法解决这个问题?
My react web app is not loading on iOS, especially v15.5.
Only black page is loaded when I access to the website using iPhone or iPad.
Is there a way to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是由于正则用法而发生的。看起来Safari还不支持LookBehind(即您的(?< =/))。一种替代方法是将 / /在非捕捉组中放置的替代品,然后仅提取第一个组( /#之后的内容和#)。
另外,(?=# *)很奇怪 - 您可能想查看某些东西(例如#或字符串的末端),而不是 *量词(零或更多##)。 使用([^#]+)完全省略(因为([^#]+)是贪婪),这可能是更好的选择。
根据您的情况,
The issue is happening because of regex usage. Looks like Safari doesn't support lookbehind yet (that is, your (?<=/)). One alternative would be to put the / that comes before in a non-captured group, and then extract only the first group (the content after the / and before the #).
Also, (?=#*) is odd - you probably want to lookahead for something (such as # or the end of the string), rather than a * quantifier (zero or more occurrences of #). It might be better to use something like
or just omit the lookahead entirely (because the ([^#]+) is greedy), depending on your circumstances.