ReactJ不在iOS上加载

发布于 2025-02-13 20:23:58 字数 96 浏览 0 评论 0原文

我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ花落谁相伴 2025-02-20 20:23:58

问题是由于正则用法而发生的。看起来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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文