FortAwesome / angular-fontawesome

Official Angular component for Font Awesome 5+
https://fontawesome.com
MIT License
1.49k stars 152 forks source link

Prod build issue with v0.6.1 #252

Closed jrista closed 4 years ago

jrista commented 4 years ago

Describe the problem

Error occurs during production build with Angular 8 and Ionic 4. Error with property 'kind' of undefined?

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 (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35)
    at checkNodeForDecorators (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:77:21)
    at visitNodes (/home/circleci/project/node_modules/typescript/lib/typescript.js:16514:30)
    at Object.forEachChild (/home/circleci/project/node_modules/typescript/lib/typescript.js:16740:24)
    at checkNodeForDecorators (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/home/circleci/project/node_modules/typescript/lib/typescript.js:16505:24)
    at Object.forEachChild (/home/circleci/project/node_modules/typescript/lib/typescript.js:16635:21)
    at checkNodeForDecorators (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31) 
    at visitNode (/home/circleci/project/node_modules/typescript/lib/typescript.js:16505:24) 
    at Object.forEachChild (/home/circleci/project/node_modules/typescript/lib/typescript.js:16703:24)
    at checkNodeForDecorators (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/home/circleci/project/node_modules/typescript/lib/typescript.js:16505:24)
    at Object.forEachChild (/home/circleci/project/node_modules/typescript/lib/typescript.js:16692:24)
    at checkNodeForDecorators (/home/circleci/project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/home/circleci/project/node_modules/typescript/lib/typescript.js:16505:24)
    at Object.forEachChild (/home/circleci/project/node_modules/typescript/lib/typescript.js:16599:21)

What did you expect?

A successful build.

Reproducible test case

Can't be done with 'blitz as its an ionic project.

1) Create new Ionic 4 app 2) Install angular-fontawesome 0.6.1 3) Reference icons in the faIconLibrary in app.module 4) ng build --prod

devoto13 commented 4 years ago

I somehow have a deja vu now... https://github.com/FortAwesome/angular-fontawesome/issues/208. 0.6.1 is not compatible with Angular 8 as described in the README.

jrista commented 4 years ago

Oh yes, I remember now. :P I upgraded all the libraries related to @fortawesome, including this one...then the build broke. Turns out, keeping it at 0.5.x works with the latest versions of the @fortawesome libs. Thanks!