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
ng build -prod Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' #4551
ERROR in Unexpected value 'null' declared by the module 'AppModule in C:/Users/T
haniri/Desktop/freecodecamp/myroute/src/app/app.module.ts'
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in
'C:\Users\Thaniri\Desktop\freecodecamp\myroute\src'
@ ./src/main.ts 3:0-74
@ multi ./src/main.ts
Mention any other details that might be useful.
ng serve works fine, its just ng build -prod
Here are the contents of my main.ts file:
`import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/app.module';
Having the same failure on both linux and windows platforms.
ERROR in Cannot read property 'map' of undefined
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/helix-app.module.ngfactory' in 'C:\Users\agarbutt\WebstormProjects\helix-ui\src' @ ./src/main.ts 3:0-85 @ multi ./src/main.ts
ERROR in this._input.charCodeAt is not a function
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/vs/Work/GoFactTables/GoFactFrontend/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
Reacted by Fernando Herrera, Mohammad Sharifi, Guilherme Ribeiro dos Santos, huiyuan and arturo schloss
This may or may not be helpful but I have noticed that the first error seems to be the primary cause and the Module not found error is generic and will happen any time something breaks the aot build.
In my case I was getting the following any time I had an empty scss file:
ERROR in Child compilation failed:
Module build failed: No input specified: provide a file name or a source string to process:
[object Object]
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/mhamel/Development/blispay/blispay-ui2/src'
@ ./src/main.ts 4:0-76
@ multi ./src/main.ts
As soon as I fixed the first error, the Module not found error resolved itself. From that, I would expect @IlyaSurmay and @agarbutt each have different project specific bugs. (Possibly aot compiler related)
Can you see if the --verbose flag gives you any more information about the error?
Reacted by Marek Słabicki, Michel Meeuwissen, iacii, Mateusz Witkowski, Ricardas, Omer Alper, Brad Ahrens, Etienne, Christian Ulmann, Adrian Moisa and 22 more
Reacted by vamstroy, Richard Lee, Lazar Ljubenović, Ofir Fridman, Anton Krylov, keerthana333 and jraut
The same thing happens for me. No error other than:
ERROR in ./src/client.aot.ts Module not found: Error: Can't resolve './$$_gendir/browser.module.ngfactory' in '/home/pradej/Projekty/site-backoffice/src' @ ./src/client.aot.ts 2:0-75
I had to make a separate, plain client entry point for AOT, but it still doesn't work.
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { MainModule } from './browser.module';
enableProdMode();
platformBrowserDynamic().bootstrapModule(MainModule);
OS: Fedora 25 x64
Also, if that's helpful, my project is using Universal, but AOT is used for client only.
I think it might be ngc. I cannot make it generate anything even when
running it directly.
16.02.2017 4:43 PM "Ilya Surmay" <notifications@github.com> napisał(a):
+1
linux mint
ERROR in this._input.charCodeAt is not a function
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/vs/Work/GoFactTables/GoFactFrontend/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4551 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATNfaOp3L5J0yev2EYWiQmUg8iZvNSx_ks5rdG6GgaJpZM4L7u-Y>
.
With the last version of angular-cli, ng build --prod seems to compile with --aot by default : I didn't know there was good practices to make project working with...
Reacted by CrankyTechGeek, peterzhao2099 and Abraham Becker
Similar problem with 1.0.0-rc1 on Windows. Running ng build --prod gives
ERROR in Error encountered resolving symbol values statically. Could not resolve events relative to C:/Projects/craft-ng/editor/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts., resolving
symbol WebDriverCommand in C:/Projects/craft-ng/editor/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Projects\craft-ng\editor\src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
ng build --prod --aot=false executes without problems.
Reacted by Steven Yates, amir shay, Dan Plaza, Kevin Ching, Gabriel Babilonia, XiaoHong Ren, birjesh3pillar, setrar, Brad Ahrens, godbasin and 91 more
Reacted by Jane Q, Limitrof, Jake Niemiec, atluri64, Michael Duane Mooring, Denis Frolov, Nir Galon, Mohammad Sharifi, Tomas, Cobus Kruger and 42 more
Reacted by Hovhannes, Tyler Brown, Collins Abitekaniza, Joe Feser, Dexter Marks-Barber, Marcelo Forclaz, jiya1, Fabio Biondi, Darryn, Nikola Jankovic and 10 more
Reacted by Dariusz Filipiak, Jeyarathnem Jeyachanthuru, Kevin Mui, Alex0007, Johan Alvarez, ryancui, Ian Chen, Jane Q, Jake Niemiec, Laura Ciro and 24 more
Reacted by Marek Słabicki, ZhimolaoG, Christopher Glantschnig, Gabriel Babilonia, Mariana Battistin, Leandro Vitale, Mario Kozjak, Diego del Corral, Tyler Brown, Collins Abitekaniza and 23 more
Just to tell everyone: I eventually dropped @ngtools/webpack completely from my project and replaced it with @ultimate/aot-loader. AOT now finally works.
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/var/www/html/v2site/lite_frontend/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
Still having this issue. All the proposed solutions don't work: no absolute paths, rootDir doesnt exist, aot=false doesn't work since buildOptimizer requires AOT. Using Angular 7.2. Any help?
Error
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\gazala\Desktop\GCDB_Workspace\GCDB6-Portal-Final\src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
Activity
agarbutt commentedon Feb 10, 2017
Having the same failure on both linux and windows platforms.
main.ts
jjaskulowski commentedon Feb 15, 2017
+1
adessilly commentedon Feb 15, 2017
+1 (on Windows 10 64bits)
IlyaSurmay commentedon Feb 16, 2017
+1
linux mint
mhamel06 commentedon Feb 16, 2017
This may or may not be helpful but I have noticed that the first error seems to be the primary cause and the Module not found error is generic and will happen any time something breaks the aot build.
In my case I was getting the following any time I had an empty scss file:
As soon as I fixed the first error, the Module not found error resolved itself. From that, I would expect @IlyaSurmay and @agarbutt each have different project specific bugs. (Possibly aot compiler related)
Can you see if the --verbose flag gives you any more information about the error?
thaniri commentedon Feb 16, 2017
http://pastebin.com/Hmrs0Kh7
CTRL+F the document for 'was generated' to find out what command I used:
ng build -prod --verbose > aFile.txt
ng build -prod --verbose
If you want to try it yourself please clone this repo:
https://github.com/thaniri/angularPortfolio
I have no empty .scss files, and even if I attempt to add something to styles.css in the src folder, I get the same error.
TheWalruzz commentedon Feb 17, 2017
The same thing happens for me. No error other than:
ERROR in ./src/client.aot.ts Module not found: Error: Can't resolve './$$_gendir/browser.module.ngfactory' in '/home/pradej/Projekty/site-backoffice/src' @ ./src/client.aot.ts 2:0-75I had to make a separate, plain client entry point for AOT, but it still doesn't work.
OS: Fedora 25 x64
Also, if that's helpful, my project is using Universal, but AOT is used for client only.
jjaskulowski commentedon Feb 17, 2017
mayachirp commentedon Feb 19, 2017
Same error when I upgraded to 4.0.0-beta.8. Previous version 4.0.0-beta.7 doesn't have this failure.
adessilly commentedon Feb 19, 2017
This is how I fixed my issues with the last version of angular-cli :
https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5#.n4b11wso1
With the last version of angular-cli, ng build --prod seems to compile with --aot by default : I didn't know there was good practices to make project working with...
Gonic0 commentedon Feb 23, 2017
See next. I found a solution for me.
I hope this helps.
pbalaga commentedon Mar 5, 2017
Similar problem with 1.0.0-rc1 on Windows. Running
ng build --prodgivesng build --prod --aot=falseexecutes without problems.TheWalruzz commentedon Mar 6, 2017
This issue was closed, any advice for people still sufferring from this error?
TheWalruzz commentedon Mar 6, 2017
Just to tell everyone: I eventually dropped @ngtools/webpack completely from my project and replaced it with @ultimate/aot-loader. AOT now finally works.
148 remaining items
jan1za commentedon Dec 28, 2018
I know this call is closed, but its the first link I found when googling, so here is my solution.
Using Angular 7.1.4, reason was I enabledIvy after upgrading from 6 to 7.
Removed the flag and all was good.
Ivy is still in Beta and should not be used in production see issue 21706
cyraid commentedon Feb 7, 2019
For me it was having "rootDir" in my tsconfig.json ...
(I needed to remove it)
omesquita commentedon Feb 13, 2019
For me it worked with this solution.
ervivekmahajan commentedon Feb 14, 2019
/ \ _ __ __ _ _ | | __ _ _ __ / | | | |
/ △ \ | ' \ / _
| | | | |/ _| '| | | | | | |/ ___ | | | | (| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
@angular/cli: 1.0.1
node: 6.14.3
os: linux x64
@angular/common: 4.3.5
@angular/compiler: 4.3.5
@angular/core: 4.3.5
@angular/forms: 4.3.5
@angular/http: 4.3.5
@angular/platform-browser: 4.3.5
@angular/platform-browser-dynamic: 4.3.5
@angular/router: 4.3.5
@angular/cli: 1.0.1
@angular/compiler-cli: 4.3.5
and this is the error
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/var/www/html/v2site/lite_frontend/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
please suggest solution asap
darkguy2008 commentedon Feb 14, 2019
@ervivekmahajan please read all the comments asap
andrewantar commentedon Mar 18, 2019
Still having this issue. All the proposed solutions don't work: no absolute paths, rootDir doesnt exist, aot=false doesn't work since buildOptimizer requires AOT. Using Angular 7.2. Any help?
AntJanus commentedon Apr 18, 2019
I still have this issue as well. I checked the various solutions but none worked for me.
sachingeniushub commentedon May 10, 2019
s/@types/googlemaps/index.d.ts (1977,5): Duplicate identifier 'OK'.
u/node_modules/@types/googlemaps/index.d.ts (2124,33): Duplicate identifier 'DEFAULT'.
plz help
Gajendrasinh commentedon May 13, 2019
Hello
i am using same version but not working. can help how to fixed this
Version:
@angular/cli: 1.0.0-rc.1
node: 8.11.4
os: win32 x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.10
Error
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\gazala\Desktop\GCDB_Workspace\GCDB6-Portal-Final\src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
Gajendrasinh commentedon May 16, 2019
This solution is not work.
This is my package version
Angular CLI: 1.7.4
Node: 8.11.4
OS: win32 x64
Angular: 2.4.10
... common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic
@angular/cli: 1.7.4
@angular/router: 3.4.10
@angular/tsc-wrapped: 0.5.2
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.9.2
webpack: 3.11.0
kannanwst commentedon Jun 11, 2019
angular 7 to 8 update face issue
yy7054wyq5 commentedon Jul 25, 2019
after these.
aot is success!
hope help u.
tindalida commentedon Jul 29, 2019
worked for me too
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.