After running ng serve
I've got an exception in terminal window:
Compiling @angular/core : module as esm5
Error: Error on worker #1: TypeError: Cannot read property 'map' of undefined
and message below:
An unhandled exception occurred: NGCC failed.
See /tmp/ng-EAdxWj/angular-errors.log
for further details.
angular-errors.log:
[error] Error: NGCC failed.
at NgccProcessor.process (/IdeaProjects/app/frontend/node_modules/@ngtools/webpack/src/ngcc_processor.js:76:19)
at /IdeaProjects/app/frontend/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:579:31
at SyncHook.eval [as call] (eval at create (/IdeaProjects/app/frontend/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (/IdeaProjects/app/frontend/node_modules/tapable/lib/Hook.js:154:20)
at Object.webpack [as webpackFactory] (/IdeaProjects/app/frontend/node_modules/webpack/lib/webpack.js:55:30)
at createWebpack (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.js:20:36)
at Object.runWebpackDevServer (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.js:46:12)
at SwitchMapSubscriber.project (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:191:32)
at SwitchMapSubscriber._next (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:49:27)
at SwitchMapSubscriber.Subscriber.next (/IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:66:18)
at /IdeaProjects/app/frontend/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
at processTicksAndRejections (internal/process/task_queues.js:97:5)
In my particular case the @angular-devkit/build-angular was updated to "^0.1002.0" in my package.json after running the npm audit fix. (This version seems to belong to angular 10, instead of the local projects' angular version (v9.1.3))
After reverting this change, everything started working again :
"@angular-devkit/build-angular": "~0.901.12"
I had the error:
Unknown arguments: use-program-dependencies, useProgramDependencies
An unhandled exception occurred: NGCC failed.
See "C:\...\angular-errors.log" for further details.
I just updated angular cli, material and core, and other modules needed to my project, then updated npm and typescript package, and that's all.
ng update @angular/cli @angular/core
npm update @angular/material @angular/cdk
npm install -g typescript@latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With