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

ZoneAwareError: Error: Cannot find module "./ngfactory/app/app.module.ngfactory" #9

Open
harishajdarevic opened this issue Dec 14, 2018 · 9 comments

Comments

@harishajdarevic
Copy link

I started to get this error starting from chapter 56-lazy-loading

I just installed dependencies and run npm run start

Error that occurs on runtime was

bootstrap e6c8b6c…:708 Uncaught
ZoneAwareError {__zone_symbol__error: Error: Cannot find module "./ngfactory/app/app.module.ngfactory"
at Object../main.ts (http://loc…, …}
message: (...)
name: (...)
originalStack: (...)
stack: (...)
toSource: ƒ ()
toString: ƒ ()
zoneAwareStack: (...)
__zone_symbol__error: Error: Cannot find module "./ngfactory/app/app.module.ngfactory" at Object../main.ts (http://localhost:4000/build/app.js:719:7) [] at webpack_require (http://localhost:4000/build/app.js:660:30) [] at fn (http://localhost:4000/build/app.js:84:20) [] at Object.5 (http://localhost:4000/build/app.js:11049:18) [] at webpack_require (http://localhost:4000/build/app.js:660:30) [] at ./main.ts.Object.defineProperty.value (http://localhost:4000/build/app.js:709:37) [] at http://localhost:4000/build/app.js:712:10 []
get message: ƒ ()
set message: ƒ (value)
get name: ƒ ()
set name: ƒ (value)
get originalStack: ƒ ()
set originalStack: ƒ (value)
get stack: ƒ ()
set stack: ƒ (value)
get zoneAwareStack: ƒ ()
set zoneAwareStack: ƒ (value)
proto: Object

There is no app.module.ngfactory.ts created as well.

Thanks

@harishajdarevic
Copy link
Author

npm install enhanced-resolve --save-dev resolved the issue.

@swingthrough
Copy link

npm install enhanced-resolve --save-dev resolved the issue.

Having the same issue but this did not solve the problem. I even contacted the support at [email protected] a few days ago but it seems they are not currently active judging from the recent slack threads.

@grobin89
Copy link

I had the same issue with 50-modules. I did the following to solve the problem:

After running ./node_modules/.bin/ngc, I noticed there was a lot Property 'X' does not exist on type 'Y'

So i bumped version 0.9.35 -> 0.9.39 for @types/core-js and seems to have fixed the issue

@ezequieltejada
Copy link

I'm having the same issue with 47-route-tracing. Tried both suggestions on this thread without luck ☹

@aldohernandez11
Copy link

@ezequieltejada I did what @grobin89 posted and it worked. You have to bump the @types/core-js versions on the package and lock-package json

@iniluap
Copy link

iniluap commented Oct 12, 2020

Hi! I also have the same problem on 47-route-tracing. I've tried both solutions, nothing seems to work. Does anyone has any other idea?

@wp777
Copy link

wp777 commented Nov 27, 2020

Neither of these solutions worked for me. Finally I managed to make it work:

  1. I discarded all changes made in previous attempts (inc. running rm -rf node_modules)
  2. I replaced [email protected] with [email protected]
  3. I replaced [email protected] with [email protected]
  4. yarn install
  5. yarn start

@aplanchamp
Copy link

aplanchamp commented Jan 9, 2021

Hello, none of the solutions worked for me.

This closed issue raises the same problem. If you check the comment of "kasparsuvi1 commented on 8 Jan 2018", he even pointed out the specific folders with the issue.
It is only a configuration problem but it is very annoying, the fastest way of fixing the problem for me was to simply copy/paste the webpack.config.js from an example without the issue (for example from 16-template-viewcontainerref) and it worked (the webpack configurations that trigger the issue are the ones using the @ultimate/aot-loader).

@pizzaman20000
Copy link

Hi, I had the same issue with the project #49. I updated it to the latest version of Angular and also got rid off the webpack.config.js
See here https://github.com/pizzaman20000/angular-pro-src/tree/master/49-router-outlet-events
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants