web-dev-qa-db-ja.com

Angular 9およびIvyの実行時エラー:未定義のプロパティ 'id'を読み取れません;ゾーン

Angular 8プロジェクトとテストがあります。Angular 9にアップグレードして、 https:// update.angular.io/#8.0:9.0l 。これはすべて問題なくスムーズに実行されました。アプリはエラーなしでコンパイルされ、すべてのテストが正常に実行されます。実行時にこのエラーが発生しています。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)
10
Shane

これを読んで同じ問題が発生している人のために。

私の解決策は、build.optionsでこれをパッケージjsonに追加することでした:


 "preserveSymlinks": true

0
sdev95