question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\temp\foobar\src' @ ./src/main.ts 3:0-74 @ multi ./src/main.ts

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [X] bug report
- [ ] feature request

Versions.

@angular/cli: 1.2.3 node: 6.10.2 os: win32 x64 @angular/animations: 4.3.1 @angular/common: 4.3.1 @angular/compiler: 4.3.1 @angular/core: 4.3.1 @angular/forms: 4.3.1 @angular/http: 4.3.1 @angular/platform-browser: 4.3.1 @angular/platform-browser-dynamic: 4.3.1 @angular/router: 4.3.1 @angular/cli: 1.2.3 @angular/compiler-cli: 4.3.1 @angular/language-service: 4.3.1

Repro steps.

npm install @angular/cli -g ng new foobar cd foobar npm install ng build --prod

The log given by the failure.

C:\temp\foobar>ng build --prod Hash: fbb89132e330aaa03dd9 Time: 7068ms chunk {0} polyfills.1553fdd8173a081c720c.bundle.js (polyfills) 177 kB {4} [initial] [rendered] chunk {1} main.c22b61509cde9fcee2d3.bundle.js (main) 1.1 kB {3} [initial] [rendered] chunk {2} styles.d41d8cd98f00b204e980.bundle.css (styles) 69 bytes {4} [initial] [rendered] chunk {3} vendor.f7457d5ac1e9743fd76f.bundle.js (vendor) 849 kB [initial] [rendered] chunk {4} inline.3a7e7a530cd68edb2099.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 ‘C:\temp\foobar\src’ @ ./src/main.ts 3:0-74 @ multi ./src/main.ts

Desired functionality.

A simple production build of a generated application. I noticed that after updating to the latest angular/cli version, I’m constantly getting this error (on all existing and all new projects).

Mention any other details that might be useful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

2reactions
jgodicommented, Jul 24, 2017
0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
I am getting ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' when I run ng build --prod ...
Read more >
27 - Stack Overflow
The error returned was: ERROR in ./src/main.server.ts Module not found: Error: Can't resolve './app/app.server.module.ngfactory'.
Read more >
Error - ADocLib
I am getting ERROR in./src/main.ts Module not found: Error: Can't resolve './gendir/app/app.module.ngfactory' when I run ng build prod.
Read more >
ng build --prod fails - Angular, Vue, React, Web ... - jQWidgets
src /app/app.module.ngfactory.js Module not found: Error: Can't resolve ... UI\src\app\entities\dashboard\main-page\block_four' ERROR in .
Read more >
Angular Error on build: 'Please add a @NgModule annotation'
src/main.ts ERROR in ./src/app/spreadsheets/spreadeditor/spreadeditor.component.ngfactory.js Module not found: Error: Can't resolve '…/…/…/…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found