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.

[ng8] TypeError: Cannot read property 'kind' of undefined

See original GitHub issue

I am getting below error in prod build.

"ngx-toastr": "^11.2.0",

Error:

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

ng --version

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.3.0
Node: 10.16.0
OS: win32 x64
Angular: 8.2.3
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.3
@angular-devkit/build-angular     0.801.3
@angular-devkit/build-optimizer   0.801.3
@angular-devkit/build-webpack     0.801.3
@angular-devkit/core              8.1.3
@angular-devkit/schematics        8.3.0
@angular/animations               8.2.5
@angular/cdk                      8.1.4
@angular/cli                      8.3.0
@angular/material                 8.1.4
@ngtools/webpack                  8.1.3
@schematics/angular               8.3.0
@schematics/update                0.803.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

angular.json

"styles": [
              "src/styles.scss",
              "src/assets/scss/style.scss",
              "node_modules/ngx-toastr/toastr.css"
            ],

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
dinohorvatcommented, Nov 5, 2019

I had the same issue. Seems like 11.2.0 broke some things.

Going back to 11.1.1 works fine.

"ngx-toastr": "11.1.1",

1reaction
scttcpercommented, Nov 7, 2019

reverted the only other change that happened between 11.1.2 and 11.2.0. I’m guessing its ng-packagr

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'kind' of undefined at ...
This problem started to occur when updating my Angular 6 project to 7.x. I opened an issue on the angular-cli github repo but...
Read more >
TypeError: Cannot read property 'kind' of undefined · Issue ...
TypeDoc exiting with unexpected error: TypeError: Cannot read property 'kind' of undefined at Object.isDeclaration (/home/surjit/practice/ ...
Read more >
ERROR TypeError: Cannot read property 'open' of undefined
I have a file manager component which is working well. I right click and select a document and "open" with the context menu....
Read more >
TypeError: Cannot read property 'kind' of undefined at ... - Dirask
TypeError : Cannot read property 'kind' of undefined. at getRootDeclaration (C:\Users\john\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:12052:21).
Read more >
ng-multiselect-dropdown - npm
If set true user can select more than one option. false. placeholder, String, Text to be show in the dropdown, when no items...
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