Issue with prod build in Angular 8 w. v0.6
See original GitHub issueDescribe the problem
When performing a production build (ng build --prod
), an error is encountered in the build optimizer.
What did you expect?
A successful production build and deployable distribution.
Reproducible test case
Working on a reproduction case…this is an Ionic 4 application, so StackBlitz is not an option.
Error message during prod build:
ERROR in ./node_modules/@fortawesome/angular-fontawesome/fesm2015/angular-fontawesome.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
at isAngularDecoratorMetadataExpression (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35)
at checkNodeForDecorators (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:77:21)
at visitNodes (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16514:30)
at Object.forEachChild (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16740:24)
at checkNodeForDecorators (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16635:21)
at checkNodeForDecorators (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16703:24)
at checkNodeForDecorators (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16692:24)
at checkNodeForDecorators (/Users/jonrista/contracts/wicshopper5/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/Users/jonrista/contracts/wicshopper5/node_modules/typescript/lib/typescript.js:16599:21)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
ng build - Angular
Option Description Value Type Default Value
‑‑aot Build using Ahead of Time compilation. boolean true
‑‑base‑href Base url for the application being built. string
‑‑delete‑output‑path Delete...
Read more >angular - Error In Runtime From Terser During Build --prod
To resolve the angular prod build issue, we need to fix the version of terser and terser-webpack-plugin to 3.14.1 in the package-lock.json.
Read more >Angular CLI + gulp: Versioning your application made easy!
Note: In this tutorial, I will be using Angular CLI v6.0.7, Angular ... "build:prod": "npm run ng:bump-version:prod && ng build --prod".
Read more >How to bundle an Angular app for production? - GeeksforGeeks
The –prod flag activates many optimization flags. One of them is –aot for Ahead Of Time compilation. Your component templates are compiled ...
Read more >Angular (web framework) - Wikipedia
1 Differences between Angular and AngularJS · 2 History. 2.1 Naming; 2.2 Version 2; 2.3 Version 4; 2.4 Version 5; 2.5 Version 6;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, it looks like 0.5.x works well with ng 8.1 and ionic 4. Nothing I’ve used out of it so far is having any problems, anyway. Prod build is working as well. I think there were just some major build system changes between 8.1 and 8.2 that seem to have broken things on a fairly broad scale (your package is far from the only one that has the same issue, it seems.)
I see. Okay, then 0.5.x should be the way to go until Ionic supports newer versions of Angular CLI.