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.

Cannot read property 'kind' of undefined after upgrade to "@angular-devkit/build-angular": "^0.1001.0",

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • build
  • serve

Is this a regression?

Yes, the previous version in which this bug was not present was: Prev version: 0.1000.7 Current Version: ^0.1001.0

Description

I’m using angular CLI project with multiple projects. After I upgrade the package json with the latest >> “@angular-devkit/build-angular”: “^0.1001.0”, I start to get this error: ERROR in Cannot read property ‘kind’ of undefined

For this command:

ng build project-name --prod --aot --source-map --build-optimizer

When I downgrade to 0.1000.7 it back to work

🔬 Minimal Reproduction

🔥 Exception or Error


ERROR in Cannot read property 'kind' of undefined

🌍 Your Environment


Angular CLI: 10.1.0
Node: 12.3.1
OS: darwin x64

Angular: 10.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.12
@angular-devkit/build-angular     0.1001.0
@angular-devkit/build-optimizer   0.901.12
@angular-devkit/build-webpack     0.901.12
@angular-devkit/core              10.1.0
@angular-devkit/schematics        10.1.0
@angular-devkit/schematics-cli    0.901.12
@angular/cdk                      10.2.0
@angular/material                 10.2.0
@ngtools/webpack                  9.1.12
@nguniversal/common               10.0.2
@nguniversal/express-engine       10.0.2
@schematics/angular               10.1.0
@schematics/schematics            0.901.12
@schematics/update                0.1001.0
rxjs                              6.6.2
typescript                        3.9.7
webpack                           4.42.0


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
alan-agius4commented, Sep 11, 2020

@ofirrifo, without debugging it’s hard to understand and find the root cause of the problem, though typically removing the lock file and node_modules does solve a number of issues.

1reaction
alan-agius4commented, Sep 8, 2020

Same cause as https://github.com/angular/angular-cli/issues/18615 where the presence of an outdate version @angular-builders/custom-webpack is causing issues during module hosting.

Kindly update @angular-builders/custom-webpack to the latest stable version.

npm i @angular-builders/custom-webpack@10 -D
rm -rf node_modules package-lock.json
npm i
/workspace/ng-issue $ npm run serve:app

> ng-issue@0.0.0 serve:app /workspace/ng-issue
> ng serve app-a --open --port=4400

Compiling @angular/core : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015

chunk {main} main.js, main.js.map (main) 59.6 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 141 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 13.2 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 2.63 MB [initial] [rendered]
Date: 2020-09-08T12:56:21.900Z - Hash: ea4902c05542db6a1b0a - Time: 13875ms
** Angular Live Development Server is listening on localhost:4400, open your browser on http://localhost:4400/ **
: Compiled successfully.
50% building 0/1 modules 1 active /workspace/ng-issue/projects/app-a/$$_lazy_route_resource lazy groupOpti
Date: 2020-09-08T12:56:23.203Z - Hash: ea4902c05542db6a1b0a
5 unchanged chunks

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'kind' of undefined at ...
This is an issue related to the Angular devkit and build optimizer and has to do with version mismatches. I ran into this...
Read more >
519 Versions - @angular-devkit/build-angular - npm
Start using @angular-devkit/build-angular in your project by running ... TypeScript icon, indicating that this package has built-in type ...
Read more >
angular/angular-cli - Gitter
node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined at ...
Read more >
[Angular, Jest] TypeError: Cannot read property 'ɵprov ... - Qiita
More than 1 year has passed since last update. ... TypeError: Cannot read property 'ɵprov' of undefined. または. Copied!
Read more >
@angular-devkit/build-angular: Versions | Openbase
Full version history for @angular-devkit/build-angular including change logs. ... Internally the Angular CLI now always set the TypeScript target to ES2022 ...
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