question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with prod build in Angular 8 w. v0.6

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
jristacommented, Nov 27, 2019

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.)

0reactions
devoto13commented, Nov 27, 2019

I see. Okay, then 0.5.x should be the way to go until Ionic supports newer versions of Angular CLI.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found