Angular 9 和 Ivy 的运行时错误:无法读取未定义的属性“id";区 [英] Runtime error with Angular 9 and Ivy: Cannot read property 'id' of undefined ; Zone
问题描述
我们有一个带有测试的 Angular 8 项目.我们正在尝试升级到 Angular 9,并完成了 https://update.angular 中的所有步骤.io/#8.0:9.0l3.这一切都很顺利,没有任何问题.该应用程序编译没有错误,所有测试运行良好.我们在运行时收到此错误.当我们关闭常春藤时,它运行良好,所以肯定与常春藤有关.
We have an Angular 8 project with tests. We are attempting to upgrade to Angular 9 and went through all the steps in https://update.angular.io/#8.0:9.0l3. This all went smoothly, no issues. The app compiles with no errors and all of the tests run fine. We are getting this error at runtime. When we turn off Ivy, it runs fine so definitely seems related to Ivy.
zone-evergreen.js:659 Unhandled Promise rejection: Cannot read property 'id' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'id' of undefined
at registerNgModuleType (core.js:35467)
at core.js:35485
at Array.forEach (<anonymous>)
at registerNgModuleType (core.js:35481)
at core.js:35485
at Array.forEach (<anonymous>)
at registerNgModuleType (core.js:35481)
at new NgModuleFactory$1 (core.js:35649)
at compileNgModuleFactory__POST_R3__ (core.js:41403)
at PlatformRef.bootstrapModule (core.js:41768) TypeError: Cannot read property 'id' of undefined
at registerNgModuleType (http://localhost:8080/vendor.js:41436:27)
at http://localhost:8080/vendor.js:41454:14
at Array.forEach (<anonymous>)
at registerNgModuleType (http://localhost:8080/vendor.js:41450:17)
at http://localhost:8080/vendor.js:41454:14
at Array.forEach (<anonymous>)
at registerNgModuleType (http://localhost:8080/vendor.js:41450:17)
at new NgModuleFactory$1 (http://localhost:8080/vendor.js:41602:13)
at compileNgModuleFactory__POST_R3__ (http://localhost:8080/vendor.js:46530:27)
at PlatformRef.bootstrapModule (http://localhost:8080/vendor.js:46859:16)
推荐答案
我尝试为我的 Angular 应用运行 build ng build --prod
.它清楚地告诉我我遇到了什么问题.你可以尝试一下,知道你需要解决什么问题.
I try to run build ng build --prod
for my Angular app. And it clear show me what problem i have.You can try it to know what you need to fix.
这篇关于Angular 9 和 Ivy 的运行时错误:无法读取未定义的属性“id";区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!