Everything was running fine yesterday, now when I try to ng serve I get these errors:
ERROR in ./src/main.ts Module build failed: TypeError
This worked for me :- rm -rf node_modules && npm cache clean && npm uninstall --save angular-cli; npm uninstall -g angular-cli; npm i --save @angular/cli && npm i -g @angular/cli && npm i
rm -rf node_modules/ in your project to get rid of all npm stuff and then npm cache clean followed by npm install should also resolve this issue. Also, make sure the versions of the cli locally and globally match.
https://github.com/angular/angular-cli/issues/3781