Here is the error getting in prod build
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/var/www/project/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
Getting error because new versions of packages being installed after running npm install. Cannot share packages version differences because the list is too lengthy. Its working with aot false
but don't want to build with aot false
. Not able to find out which package is responsible for this.
Try
or add it to your
shrinkwrap.json
orpackage-lock.json
oryarn.lock
or update angular-cli as said Filipe SilvaI also had issue with
enhanced-resolve
: angular-cli didn't respect my--environment
flagSee also this thread
I solved it with this thread
https://github.com/angular/angular-cli/issues/7113