ultimatecourses/angular-pro-src

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

Opened this issue · 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

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

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 support@ultimateangular.com a few days ago but it seems they are not currently active judging from the recent slack threads.

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

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

@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

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 commented

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 node-sass@4.5.0 with node-sass@5.0.0
  3. I replaced reflect-metadata@0.1.10 with reflect-metadata@0.1.13
  4. yarn install
  5. yarn start

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

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