Angular 6 TypeError: Cannot read property 'call' of undefined
Issue FIXED by angular-cli team, you just need to update your "webpack": "^4.15.1"
Good luck.
This was my earlier answer.
This is an open-label:comp: devkit/build-angular
issue in angular-cli.
Yes, you are right in the ng serve
you don't see the error. Even I faced the same error while developing my application, I did end my ng serve
and tried again, it worked and the ng build --prod
is also successful. Please refer to the below-provided link, you will get to know more on this.
https://github.com/angular/angular-cli/issues/11129
I think it happens when you make changes to module imports during run time.
Run the application again using ng serve
and it fixed the issue for me.
It may also occur when you try to use components of lazy loaded modules in other modules before the lazy module getting loaded or such similar scenarios.