angular-pro-src icon indicating copy to clipboard operation
angular-pro-src copied to clipboard

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

Open harishajdarevic opened this issue 6 years ago • 9 comments

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 avatar Dec 14 '18 10:12 harishajdarevic

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

harishajdarevic avatar Dec 14 '18 12:12 harishajdarevic

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.

swingthrough avatar Jan 24 '19 13:01 swingthrough

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

grobin89 avatar Aug 27 '19 06:08 grobin89

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

ezequieltejada avatar Feb 10 '20 09:02 ezequieltejada

@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

aldohernandez11 avatar Aug 02 '20 14:08 aldohernandez11

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?

iniluap avatar Oct 12 '20 19:10 iniluap

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

wp777 avatar Nov 27 '20 17:11 wp777

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).

aplanchamp avatar Jan 09 '21 15:01 aplanchamp

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

pizzaman20000 avatar Jan 18 '21 09:01 pizzaman20000