Reputation: 131
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.
Upvotes: 0
Views: 21