运行时问题
空白应用
备注
我的应用没有错误。为什么显示空白屏幕?
有几个不同的原因可能导致这种情况。如果您无法在 Ionic 论坛 上找到解决方案,请确保:
- 没有为旧版浏览器/Android 版本包含 polyfills
对于使用 @angular/cli@7.3 或更高版本的项目,polyfills 将自动包含。对于在此之前的项目,需要手动启用 polyfills。
在 src/polyfills.ts 中,您必须为 Android 4.4 支持启用所有 ES6 polyfills。
或者,可以将项目更新为使用最新版本的 @angular/cli 包和 @angular-devkit 包,并在 angular.json 的构建选项对象中包含 es5BrowserSupport 选项:
"input": "src/global.scss"
}
],
- "scripts": []
+ "scripts": [],
+ "es5BrowserSupport": true
},
"configurations": {
"production": {
这将自动为需要它们的旧版浏览器包含 polyfills。