Repository navigation
AOT build fails #7113
Copy link
Copy link
Closed
Labels
P0Issue that causes an outage, breakage, or major function to be unusable, with no known workaroundsIssue that causes an outage, breakage, or major function to be unusable, with no known workaroundsworkaround2: non-obvious
Description
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.2.3
node: 6.11.1
os: darwin x64
@angular/animations: 4.3.1
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.3
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1
Repro steps.
$ ng new hello
$ cd hello
$ ng build --prod
The log given by the failure.
$ ng build --prod
Hash: edf6fb3ccb1b82fa940c
Time: 10775ms
chunk {0} polyfills.71b130084c52939ca448.bundle.js (polyfills) 177 kB {4} [initial] [rendered]
chunk {1} main.e81f19d3f6b27a436c79.bundle.js (main) 1.09 kB {3} [initial] [rendered]
chunk {2} styles.d41d8cd98f00b204e980.bundle.css (styles) 69 bytes {4} [initial] [rendered]
chunk {3} vendor.f7457d5ac1e9743fd76f.bundle.js (vendor) 849 kB [initial] [rendered]
chunk {4} inline.18e445e37a0efd4dcfa2.bundle.js (inline) 0 bytes [entry] [rendered]
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'hello/src'
@ ./src/main.ts 3:0-74
@ multi ./src/main.ts
Desired functionality.
aot build runs
Mention any other details that might be useful.
Maybe, enhanced-resolve 3.4.0 is cause.
webpack/enhanced-resolve#98
ng build --prod runs successfully after npm i enhanced-resolve@3.3.0 .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Issue that causes an outage, breakage, or major function to be unusable, with no known workaroundsIssue that causes an outage, breakage, or major function to be unusable, with no known workaroundsworkaround2: non-obvious
Activity
mchmielarski commentedon Jul 24, 2017
I noticed same problem and after
npm i enhanced-resolve@3.3.0I can build with AOTMasDevProject commentedon Jul 24, 2017
Same problem here
serhiisol commentedon Jul 24, 2017
@mchmielarski That's a very nice guess 👍
zucker-rdrg commentedon Jul 24, 2017
Same here.
workaround:
npm install enhanced-resolve@3.3.0jahller commentedon Jul 24, 2017
thanks for the solution guys, this problem just cost us the whole morning.
adding
enhanced-resolve@3.3.0solved it.ChrisCherryfarmer commentedon Jul 24, 2017
Thx, same here.
enhanced-resolve@3.3.0solved the issue.kondi0 commentedon Jul 24, 2017
The same here!
enhanced-resolve@3.3.0 solved it!
hpyou commentedon Jul 24, 2017
thanks god for this issue, i fixed this problem the whole day
thegitty commentedon Jul 24, 2017
Workaround with "enhanced-resolve@3.3.0" seems to work on Mac OS but not on Linux!? Can anyone confirm this behavior?
sculeb commentedon Jul 24, 2017
works on linux ubuntu 16.04 for me
TautvydasDerzinskas commentedon Jul 24, 2017
Same issue.
TautvydasDerzinskas commentedon Jul 24, 2017
Guys, you should really use fixed dependency versions for Angular-Cli. It's been a millionth time when everything breaks because in new versions of sub dependencies there is something unexpected...
fix(ui): fixdeps: angular/angular-cli#7113
cankayacan commentedon Jul 24, 2017
The angular-cli version is already fixed for us which is 1.3.1 but still we have this error.
bmcswee commentedon Jul 24, 2017
Same issue for me. Resolved with
enhanced-resolve@3.3.0on Ubuntu Server.RIP the first 2 hours of my morning.
175 remaining items
change build command and refactor scripts
bhushangahire commentedon Nov 9, 2017
I am getting the same issue for Angular CLI 1.5.0 I also have Enhanced resolve 3.3.0
eduibrahim commentedon Nov 9, 2017
Me too. Still getting: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
Even after use Angular CLI 1.5.0 and Enhanced resolve 3.3.0
stefdelec commentedon Dec 4, 2017
Same here. Any Update ?
manpreetpc commentedon Jan 1, 2018
enhanced-resolve@3.3.0 is not work for me
package.json
{
"name": "LENDZ",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@ionic-native/camera": "^4.4.2",
"@ionic-native/core": "4.3.2",
"@ionic-native/diagnostic": "^4.5.2",
"@ionic-native/facebook": "^4.4.2",
"@ionic-native/file": "^4.4.2",
"@ionic-native/file-path": "^4.4.2",
"@ionic-native/geolocation": "^4.4.2",
"@ionic-native/google-maps": "^4.4.2",
"@ionic-native/http": "^4.4.2",
"@ionic-native/native-storage": "^4.4.2",
"@ionic-native/network": "^4.5.2",
"@ionic-native/onesignal": "^4.5.2",
"@ionic-native/push": "^4.4.2",
"@ionic-native/splash-screen": "4.3.2",
"@ionic-native/status-bar": "4.3.2",
"@ionic-native/stripe": "^4.5.2",
"@ionic-native/transfer": "^3.14.0",
"@ionic/storage": "^2.1.3",
"angular2-moment": "^1.7.0",
"cordova-android": "6.3.0",
"cordova-browser": "~5.0.1",
"cordova-plugin-camera": "^3.0.0",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-facebook4": "^1.9.1",
"cordova-plugin-file": "^5.0.0",
"cordova-plugin-file-transfer": "^1.7.0",
"cordova-plugin-filepath": "^1.1.0",
"cordova-plugin-geolocation": "^3.0.0",
"cordova-plugin-googlemaps": "^2.1.1",
"cordova-plugin-inappbrowser": "~1.7.2",
"cordova-plugin-ionic-webview": "^1.1.11",
"cordova-plugin-nativestorage": "^2.2.2",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-stripe": "^1.5.3",
"cordova-plugin-whitelist": "^1.3.1",
"cordova-sqlite-storage": "^2.1.2",
"cordova.plugins.diagnostic": "^3.7.2",
"enhanced-resolve": "^3.4.1",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionic2-rating": "^1.2.2",
"ionicons": "3.0.0",
"onesignal-cordova-plugin": "^2.2.4",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "^3.1.7",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-facebook4": {
"APP_ID": "xxxxxxxxxxx",
"APP_NAME": "LENDZ"
},
"cordova-plugin-nativestorage": {},
"cordova-sqlite-storage": {},
"cordova-plugin-camera": {},
"cordova-plugin-file": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-filepath": {},
"cordova-plugin-googlemaps": {
"API_KEY_FOR_ANDROID": "xxxxxxxxxxxxxxxxxxxxxx",
"API_KEY_FOR_IOS": "xxxxxxxxxxxxxxxxxxxx"
},
"cordova-plugin-geolocation": {},
"onesignal-cordova-plugin": {},
"cordova.plugins.diagnostic": {},
"cordova-plugin-network-information": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-stripe": {}
},
"platforms": [
"browser",
"android"
]
}
}
Please help
Sparker73 commentedon Jan 19, 2018
As @cbeaujoin well said. If you leave it like this you will build with AOT without troubles.
I have to add that typescript had to be 2.3.4 for me, and the best of all, the build time was drastically reduced to around 6:35 when before it was taking about 29min to build. I will stay like this for a while.
fix(build): fix AOT issues when building for production
fix(build): fix AOT issues when building for production
jkrajinovic commentedon Mar 6, 2018
enhanced-resolve@3.3.0 solved it!
added "enhanced-resolve": "^3.3.0" to fix AoT build
fix(@ngtools/webpack): pin enhanced-resolve
Some magic that i dont understand, angular/angular-cli#7113
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
feat(forms): add updateOn blur option to FormControls (angular#18408)