You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I can't build AOT and the error is giving me nothing? #5294
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '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/Users/baypublishing/projects/vvink/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
I Still see this error which doesn't say much.
Uninstalled @angular-cli local and global.
Received the error with both TS 2.2.1 and 2.0.10
The only thing that seems to makes it work is removing my nested lazy loaded module.
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/florinbardosi/Project/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
Error
at factoryCallback (/Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/Compilation.js:259:39)
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:234:19
at onDoneResolving (/Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:59:20)
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:126:20
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:3694:9
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:356:16
at iteratorCallback (/Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:934:13)
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:840:16
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:3691:13
at apply (/Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:21:25)
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:56:12
at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:121:22
at onResolved (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:70:11)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at afterInnerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:138:10)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at Resolver.applyPluginsAsyncSeriesBailResult1 (/Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:181:46)
at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:125:19)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at /Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:283:15
at /Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:38:4
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at afterInnerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:138:10)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at Resolver.applyPluginsAsyncSeriesBailResult1 (/Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:181:46)
at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:125:19)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at /Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:283:15
at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:123:11)
at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
resolve './../$$_gendir/src/app/app.module.ngfactory' in '/Users/alex/Sites/project-api/frontend/src'
using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./src)
using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./$$_gendir/src/app/app.module.ngfactory)
as directory
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory doesn't exist
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.json doesn't exist
.css
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.css doesn't exist
.scss
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.scss doesn't exist
.html
Field 'browser' doesn't contain a valid alias configuration
/Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.html doesn't exist
Just upgraded to @angular/cli: 1.0.0-rc.2
In a fresh ng new project, ng build -prod builds fine.
My project builds and runs fine with:
ng serve
ng build --environment prod --output-hashing=all
However, these break:
ng build -prod
ng build --environment prod --output-hashing=all --target=production
I'm not sure exactly what -prod or --target=production trigger (AOT?) but the build results in this error:
ERROR in Error encountered resolving symbol values statically. Expression form not supported (position 15:13 in the original .ts file), resolving symbol SearchInputComponent in /home/whitea/Code/boost_dashboard/src/app/shared/search-input/search-input.component.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/whitea/Code/boost_dashboard/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
SearchInputComponent is the first declared and exported Component in a shared module.
main > AppModule > CoreModule > CoreSharedModule > SearchInputComponent
CoreSharedModule is where I put Components needed by AppComponent in addition to other modules.
Reacted by Cristian Ramirez, Simon Altschuler and Xiangpeng Li
So I think there's probably a few different bugs going on in this issue, but I have a repro for the error that @florinbardosi originally got in a repo at https://github.com/ycros/angular-aot-cryptic-error-repro - in my case it's including a dependency that I guess is incompatible with AOT in some way, and the actual bug is that the error needs to be clearer.
Hey @hansl is there another ticket where this is being more actively investigated or is this on hold? AOT reporting with the ngfactory can be quite difficult to decipher.
Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)
Activity
RicardoVaranda commentedon Mar 8, 2017
Hi @borntodesign ,
This seemed to have been a problem last month due to users not deleting all of their @angular-cli references. Could you please ensure you run:
Within your app folder, also what version of ts are you using?
farin99 commentedon Mar 12, 2017
Hi @RicardoVaranda ,
I Still see this error which doesn't say much.
Uninstalled @angular-cli local and global.
Received the error with both TS 2.2.1 and 2.0.10
The only thing that seems to makes it work is removing my nested lazy loaded module.
florinbardosi commentedon Mar 14, 2017
Hi all,
I'm having the same issue
ERROR in Cannot read property 'text' of undefined
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/florinbardosi/Project/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
@angular/cli: 1.0.0-rc.2
node: 6.9.5
os: darwin x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 2.4.9
@angular/language-service: 2.4.8
borntodesign commentedon Mar 15, 2017
@RicardoVaranda I actually have since copied it into a completely fresh angular-cli project and still no joy?
alex88 commentedon Mar 16, 2017
In my case I have just
with no explanation on what the problem is
arlowhite commentedon Mar 16, 2017
Just upgraded to @angular/cli: 1.0.0-rc.2
In a fresh
ng newproject,ng build -prodbuilds fine.My project builds and runs fine with:
However, these break:
I'm not sure exactly what -prod or --target=production trigger (AOT?) but the build results in this error:
SearchInputComponent is the first declared and exported Component in a shared module.
main > AppModule > CoreModule > CoreSharedModule > SearchInputComponent
CoreSharedModule is where I put Components needed by AppComponent in addition to other modules.
alex88 commentedon Mar 16, 2017
Why everyone here has at least an error and I don't have anyhting? :D
alex88 commentedon Mar 16, 2017
In my case I solved by removing
--bailoption from webpack, so that the error actually shows during build!florinbardosi commentedon Mar 16, 2017
I had a dummy file from a previous implementation where we used ngrx. After I've removed the file it's working again.
filipesilva commentedon Mar 17, 2017
If you can provide a simple repro we can investigate.
jimbarrett33 commentedon Mar 24, 2017
Today, I was able to build fine with
ng build -prod --aoton a new project with the v1.0.0 of the cli.However, I do get the error with the latest version of the AotPlugin and on a basic app:
"@ngtools/webpack": "^1.3.0"- error"@ngtools/webpack": "^1.2.8"- no errorModule not found: Error: Can't resolve '../aot/app/app.module.ngfactory'
I don't know in which version it started to break.
ycros commentedon Mar 25, 2017
So I think there's probably a few different bugs going on in this issue, but I have a repro for the error that @florinbardosi originally got in a repo at https://github.com/ycros/angular-aot-cryptic-error-repro - in my case it's including a dependency that I guess is incompatible with AOT in some way, and the actual bug is that the error needs to be clearer.
jimbarrett33 commentedon Mar 27, 2017
Regarding the AotPlugin, in #5329 the fix/workaround by proposed by @tinchou worked for me. It is a window-specific problem.
7 remaining items
niikoo commentedon Aug 11, 2017
+1
Works with --aot=false
ben-coble-sp commentedon Oct 3, 2017
Hey @hansl is there another ticket where this is being more actively investigated or is this on hold? AOT reporting with the ngfactory can be quite difficult to decipher.
mgechev commentedon Dec 18, 2018
Can you reproduce this issue with the latest CLI? If this is still valid, would you provide a minimal demo where we can reproduce the problem?
mgechev commentedon Dec 21, 2018
Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)
angular-automatic-lock-bot commentedon Sep 9, 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.