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.

Angular Prod Build Failure: Cannot read property 'kind' of undefined

See original GitHub issue
Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

Angular version: 8.0.2 ng2-pdf-viewer version: 6.1.2

When doing ng build everything works, but when trying to do ng build --prod I get this error:

ERROR in ./node_modules/ng2-pfd-viewer/fesm5/ng2-pdf-viewer.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 (C:\Projects\test_project\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

8reactions
FiringBlankscommented, May 16, 2020

Downgrading to v5.3.4 worked for me

npm uninstall ng2-pdf-viewer then npm install ng2-pdf-viewer@5.3.4

4reactions
NikhilP97commented, Jun 18, 2020

After searching for a long time, this worked for me. Upgraded @angular-devkit/build-angular to version: “~0.803.19” and then prod build worked fine. Made the following change in package.json. ` “devDependencies”: {

"@angular-devkit/build-angular": "~0.803.19",

… } `

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'kind' of undefined at ...
I ran into this issue, and it turns out that @angular-devkit/build-angular was ...
Read more >
ERROR in Cannot read property 'kind' of undefined - Angular ...
ERROR in Cannot read property 'kind' of undefined. The error shows up in the terminal at the end of the compilation process and...
Read more >
Toolips ng build –prod error - MDBootstrap
when I was trying to build production of my project we got this error: in Error: TypeError: Cannot read property 'kind' of undefined...
Read more >
angular-cli - Cannot read property 'kind' of undefined - iTecNote
if I build with not --prod I do not get any error. Full error: ERROR in TypeError: Cannot read property 'kind' of undefined...
Read more >
angular/angular-cli - Gitter
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of ...
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