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
npm i enhanced-resolve@3.3.0
or add it to your shrinkwrap.json
or package-lock.json
or yarn.lock
or update angular-cli as said Filipe Silva
We've released 1.2.4/1.3.0-rc.1 to fix this issue
I also had issue with enhanced-resolve
: angular-cli didn't respect my --environment
flag
See also this thread
- https://github.com/angular/angular-cli/issues/7113
- npm clean cache
- Delete node_modules
- Add "enhanced-resolve": "3.3.0" in your package.json
- run npm install
- rebuild !
I solved it with this thread
https://github.com/angular/angular-cli/issues/7113