Skip to content

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

Open

Description

@harishajdarevic

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

Activity

  1. harishajdarevic commented on Dec 14, 2018

    @harishajdarevic
    Author

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

  2. swingthrough commented on Jan 24, 2019

    @swingthrough

    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.

  3. grobin89 commented on Aug 27, 2019

    @grobin89

    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

  4. ezequieltejada commented on Feb 10, 2020

    @ezequieltejada

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

  5. aldohernandez11 commented on Aug 2, 2020

    @aldohernandez11

    @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

  6. iniluap commented on Oct 12, 2020

    @iniluap

    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?

  7. wp777 commented on Nov 27, 2020

    @wp777

    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
  8. aplanchamp commented on Jan 9, 2021

    @aplanchamp

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

  9. pizzaman20000 commented on Jan 18, 2021

    @pizzaman20000

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions