admin管理员组文章数量:1316588
We recently upgraded the Angular app to version 19.
Dev build is running fine, but in prod build we are getting the below error.
My prod settings are below in angular.json file
"optimization" : true,
"extractLicenses" : true,
"sourceMap" : false,
"namedChunks" : false,
"aot" : true,
"buildOptimizer" : true,
If we disable optimization or buildOptimizer, the build works fine. I suspect the issue is related to tree shaking.
To look into more detail, I enabled the SourceMap for PROD build.
Upon inspection, the error originates from the core.mjs which I am sure it is from @angular/core
I compare side by side in 2 browser and put the breakpoints inside the source file core.mjs.
By comparing side-by-side in two browsers and setting breakpoints inside the core.mjs source file, I identified a specific location that executes in the development build but not in the production build.
PROD BUILD DEVELOPER OPTIONS
DEV BUILD DEVELOPER OPTIONS
本文标签: angular19Angular Upgrade v19 Dev Builds Fine but Prod Build Runtime Error NullInjectorStack Overflow
版权声明:本文标题:angular19 - Angular Upgrade v19 Dev Builds Fine but Prod Build Runtime Error NullInjector - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741961205a2407289.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论