Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' #7151

Closed
rtm opened this issue Jul 26, 2017 · 18 comments
Closed

Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' #7151

rtm opened this issue Jul 26, 2017 · 18 comments

Comments

@rtm
Copy link

@rtm rtm commented Jul 26, 2017

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

angular-cli 1.2.0
node 6.x
npm 3.x

The log given by the failure.

I'm getting a Module not found error with no additional information. --verbose provides no additional useful information.

What kinds of things could account for this type of error?

[rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$ ng build --prod
Hash: e7dae1738ac862e19a00
Time: 21314ms
chunk    {0} polyfills.71b130084c52939ca448.bundle.js (polyfills) 177 kB {5} [initial] [rendered]
chunk    {1} scripts.cf4bd508b777cd0dcd0a.bundle.js (scripts) 318 kB {5} [initial] [rendered]
chunk    {2} main.37ea370eb898e54aed3a.bundle.js (main) 1.11 kB {4} [initial] [rendered]
chunk    {3} styles.48601ea560e407313063.bundle.css (styles) 69 bytes {5} [initial] [rendered]
chunk    {4} vendor.bfdee3afc7b1496cdc22.bundle.js (vendor) 849 kB [initial] [rendered]
chunk    {5} inline.8ed31a5e25b6accbf838.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 '/home/rtm/repos/TNF/identity-ui/src'
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts
[rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$
@rtm rtm changed the title [rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$ ng build --prod Hash: e7dae1738ac862e19a00 Time: 21314ms chunk {0} polyfills.71b130084c52939ca448.bundle.js (polyfills) 177 kB {5} [initial] [rendered] chunk {1} scripts.cf4bd508b777cd0dcd0a.bundle.js (scripts) 318 kB {5} [initial] [rendered] chunk {2} main.37ea370eb898e54aed3a.bundle.js (main) 1.11 kB {4} [initial] [rendered] chunk {3} styles.48601ea560e407313063.bundle.css (styles) 69 bytes {5} [initial] [rendered] chunk {4} vendor.bfdee3afc7b1496cdc22.bundle.js (vendor) 849 kB [initial] [rendered] chunk {5} inline.8ed31a5e25b6accbf838.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 '/home/rtm/repos/TNF/identity-ui/src' @ ./src/main.ts 3:0-74 @ multi ./src/main.ts [rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$ ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/rtm/repos/TNF/identity-ui/src' @ ./src/main.ts 3:0-74 @ multi ./src/main.ts [rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$ Jul 26, 2017
@rtm rtm changed the title ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/rtm/repos/TNF/identity-ui/src' @ ./src/main.ts 3:0-74 @ multi ./src/main.ts [rtm@rtm-desktop-15 ~/repos/TNF/identity-ui]$ Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' Jul 26, 2017
@rtm rtm closed this Jul 26, 2017
@llewellyncollins
Copy link

@llewellyncollins llewellyncollins commented Jul 30, 2017

@rtm What was the solution?

Loading

@atereshkov
Copy link

@atereshkov atereshkov commented Jul 30, 2017

@llewellyn1411 update angular-cli to v1.0.26, its solved issue for me.
#7113

Loading

@llewellyncollins
Copy link

@llewellyncollins llewellyncollins commented Jul 31, 2017

@handioq Thanks. I have updated to 1.2.6 and it works.

Loading

@adrian-chang-alcover
Copy link

@adrian-chang-alcover adrian-chang-alcover commented Aug 3, 2017

Thanks @llewellyn1411 I updated to 1.2.6 and it works

Loading

@InsaneNaman
Copy link

@InsaneNaman InsaneNaman commented Aug 3, 2017

Working After updating to 1.2.6 . Thanks 😄

Loading

@IRCraziestTaxi
Copy link

@IRCraziestTaxi IRCraziestTaxi commented Aug 10, 2017

I have tried solutions from half a dozen issues pertaining to this error today and none of them have worked. Is it seriously this difficult to get around this error!?

Loading

@KUSH42
Copy link

@KUSH42 KUSH42 commented Aug 11, 2017

npm install enhanced-resolve@3.3.0
Did the trick for me

Loading

@djindjic
Copy link

@djindjic djindjic commented Sep 18, 2017

just to link an issue opened on enhanced-resolve repo webpack/enhanced-resolve#114

Loading

@tdekoekkoek
Copy link

@tdekoekkoek tdekoekkoek commented Sep 20, 2017

I've found that any enums with a 0 cause this error, so:

export enum SearchState {
simple = 0,
advanced = 1,
extended = 2
}

fails, but

export enum SearchState {
simple = 1,
advanced = 2,
extended = 3
}

does not.

Loading

@apedano
Copy link

@apedano apedano commented Sep 22, 2017

Update dependency "@angular/cli": "1.2.6" resolved my problem too,
thank you guys

Loading

@Mehul1995
Copy link

@Mehul1995 Mehul1995 commented Oct 5, 2017

npm install enhanced-resolve@3.3.0

works for me too!!

Loading

@imuneer
Copy link

@imuneer imuneer commented Oct 27, 2017

Upgrade the angular-cli globally and create a new project then copy the source and compile. It solved my issue. My Angular CLI version after upgraded is 1.4.9 and angular version is 4.2.4.

Loading

@IRCraziestTaxi
Copy link

@IRCraziestTaxi IRCraziestTaxi commented Oct 27, 2017

I left a comment on another issue similar to this one, but my case was actually more like this one - no other errors besides the extremely unhelpful Can't resolve './$$_gendir/app/app.module.ngfactory' .... My problem turned out to be very obscure and I was lucky to find it via trial and error by looking at another new project I had created. Hopefully my comment there will help somebody out with a similar issue to mine.

Loading

@bigOconstant
Copy link

@bigOconstant bigOconstant commented Nov 10, 2017

npm install enhanced-resolve@3.3.0

Works for me too. Don't know why. ¯_(ツ)_/¯

Loading

@iamrajthomas
Copy link

@iamrajthomas iamrajthomas commented Nov 22, 2017

Thank you so very much. This command worked for me on deployment. But could anybody explain how this worked?
.....
npm install enhanced-resolve@3.3.0

.....

Loading

zuzust added a commit to adab1ts/veinapp that referenced this issue Dec 4, 2017
@nandhuems
Copy link

@nandhuems nandhuems commented Dec 12, 2017

update npm install enhanced-resolve@3.3.0
for me it's working fine

Loading

@ssjoy76
Copy link

@ssjoy76 ssjoy76 commented Sep 25, 2018

This command is 100% work for solving this problem.
npm install enhanced-resolve@3.3.0

Loading

@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented 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.

Loading

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet