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