简体   繁体   English

在 ios 13 上运行 Angular 9 应用程序的空白页

[英]Blank page running Angular 9 app on ios 13

I have issues loading my Angular 9 app on iPhone, it loads in all desktop browsers and android devices, just got an blank page in iPhone.我在 iPhone 上加载我的 Angular 9 应用程序时遇到问题,它加载到所有桌面浏览器和 android 设备中,只是在 iPhone 中得到一个空白页。 It raises an promiseReactionJob exception in the polyfills-es2015 file.. running the lasted iOS version (13.4.1).它在 polyfills-es2015 文件中引发了 promiseReactionJob 异常。运行最新的 iOS 版本(13.4.1)。 I see the in the index.html, the scripts are loaded as expected.我在 index.html 中看到,脚本按预期加载。

<script src="runtime-es2015.c741d58c5f0062b819ef.js" crossorigin="use-credentials" type="module">    </script>
<script src="runtime-es5.c741d58c5f0062b819ef.js" crossorigin="use-credentials" nomodule defer></script>
<script src="polyfills-es5.1e423cd55d051bbc2156.js" crossorigin="use-credentials" nomodule defer></script>
<script src="polyfills-es2015.367a122fcc429806387a.js" crossorigin="use-credentials" type="module"></script>
<script src="main-es2015.80003c523586b89abce8.js" crossorigin="use-credentials" type="module"></script>
<script src="main-es5.80003c523586b89abce8.js" crossorigin="use-credentials" nomodule defer></script>

It is production build: ng build --prod它是生产版本: ng build --prod

The error below:下面的错误:

在此处输入图像描述

Or, disabling the --prod或者,禁用 --prod

在此处输入图像描述

The issue was due Safari/iOS doesn't implement addEventListener/RemoveEventListener, so the app called an undefined method and raised the exception.问题是由于 Safari/iOS 没有实现 addEventListener/RemoveEventListener,所以应用程序调用了未定义的方法并引发了异常。 My fix was to add an iOS check and call addListener and removeListener only on iOS as addEventListener/RemoveEventListener were not in fem2015/layout.js loaded by Safari on iOS (tried iOS >= 12). My fix was to add an iOS check and call addListener and removeListener only on iOS as addEventListener/RemoveEventListener were not in fem2015/layout.js loaded by Safari on iOS (tried iOS >= 12).

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM