Angular 9和Ivy的运行时错误:无法读取undefined的属性"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的运行时错误:无法读取undefined的属性"id";区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!