exportarts / ngx-cookie-banner

An unopinionated cookie banner for Angular
MIT License
6 stars 2 forks source link

Angular 8 --prod build issue #6

Open dkruchok opened 4 years ago

dkruchok commented 4 years ago

An error when I run ng build --prod

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

packages.json `

"@angular-devkit/core": "^8.3.20",
"@angular-devkit/schematics": "^8.3.20",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.1.1",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",`

This issue doesn't appear if I run it with ng build --prod --build-optimizer=false But that's not a solution =)

evolkmann commented 4 years ago

Hi @dkruchok, please excuse the late reply, I was not notified about the issue (will set that up now ..). I did not encounter the issue, although I am only using it with Angular 9 projects.

Can you please shortly inform me if this is still an issue for you? If so, I am happy to try it out with an ng8 project. Of course, the workaround you mention is not a solution.

Thanks, Enzo