angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open rtm opened this issue 9 years ago • 18 comments

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 avatar Jul 26 '17 18:07 rtm

@rtm What was the solution?

llewellyncollins avatar Jul 30 '17 15:07 llewellyncollins

@llewellyn1411 update angular-cli to v1.0.26, its solved issue for me. https://github.com/angular/angular-cli/issues/7113

atereshkov avatar Jul 30 '17 17:07 atereshkov

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

llewellyncollins avatar Jul 31 '17 19:07 llewellyncollins

Thanks @llewellyn1411 I updated to 1.2.6 and it works

adrian-chang-alcover avatar Aug 03 '17 15:08 adrian-chang-alcover

Working After updating to 1.2.6 . Thanks :smile:

InsaneNaman avatar Aug 03 '17 18:08 InsaneNaman

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!?

IRCraziestTaxi avatar Aug 10 '17 21:08 IRCraziestTaxi

npm install [email protected] Did the trick for me

KUSH42 avatar Aug 11 '17 12:08 KUSH42

just to link an issue opened on enhanced-resolve repo https://github.com/webpack/enhanced-resolve/issues/114

djindjic avatar Sep 18 '17 08:09 djindjic

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.

tdekoekkoek avatar Sep 20 '17 13:09 tdekoekkoek

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

apedano avatar Sep 22 '17 15:09 apedano

npm install [email protected]

works for me too!!

Mehul1995 avatar Oct 05 '17 10:10 Mehul1995

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.

imuneer avatar Oct 27 '17 07:10 imuneer

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.

IRCraziestTaxi avatar Oct 27 '17 15:10 IRCraziestTaxi

npm install [email protected]

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

bigOconstant avatar Nov 10 '17 02:11 bigOconstant

Thank you so very much. This command worked for me on deployment. But could anybody explain how this worked? ..... npm install [email protected]

.....

iamrajthomas avatar Nov 22 '17 06:11 iamrajthomas

update npm install [email protected] for me it's working fine

nandhuems avatar Dec 12 '17 13:12 nandhuems

This command is 100% work for solving this problem. npm install [email protected]

ssjoy76 avatar Sep 25 '18 19:09 ssjoy76

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.