-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' #7125
Comments
Happens for me too. These are the versions of my project:
|
I solved it setting the |
I did a successful ng build -prod a couple of hours ago, but now I get the same error without changing nothing to my project. |
@marius-oprea same thing just happened to me. |
I'm getting the same error too. Updating zone.js did not work for me. |
Happening here as well. Very odd. Tried messing around with a lot of different versions of Angular, Angular CLI, Zone.js and others with no luck. |
Same here, tried updating zone.js and it did not work |
We eventually solved it by mass updating our node packages. Not sure which one solved the problem, wasn't zone.js though. |
@bcravens can you share your package.json? |
updating to @angular/cli 1.2.4 and the other packages to the latest version solved the issue for me. |
Change your package.json to |
Updating to @angular-cli: 1.2.4 fixed the issue for me. |
The patch rc.1 was released to address this, but others still indicate problems with rc.1 here: #7113. rc.1 fixed most of my apps, but for some sample projects I was using a tsconfig with 'include: []', relying on ng to pass my entrypoint to the compiler. When using AOT you will get this error even in rc.1 unless you include the entry points explicitly in tsconfig. |
None of the package updating worked for me but adding enhanced-resolve: 3.3.0 did. See #4551 |
@angular/cli: 1.2.4 fix the problem |
@angular/cli: 1.2.4 fixed the problem for me also - this on VSTS Hosted |
Getting the same error. CLI 1.2.4 and Zone 0.8.14 did not resolve the problem for me |
Updating to @angular/cli: 1.2.4 also fixed the problem for me. |
If updating to 1.2.4 doesn't work for you. Make sure you remove your |
Oh, @PierreDuc It would be nice, if you were right... |
@atiris Are you running on linux or windows? For some reason enhanced-resolve: 3.3.0 fixes it for my on windows, but not on linux. It's the same version of npm and node on both machines. |
@atiris Have you cleared your npm cache, and removed the angular-cli global package? |
@PierreDuc I do my complete procedure again just now:
@flauc I run it on windows. My actual versions:
|
I am also having the same problem, Tried all solutions mentioned above
The project is newly generated by the command
|
@angular/cli: 1.2.4 fix the problem, but can't ng build --prod --aot, I got
The last fine build was done before angular 4.3 |
Same issue here... only fix for me seems to be changing build script to use |
Heya, please see #7113 (comment) for this issue. |
Updating to |
|
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' angular/angular-cli#7125 angular/angular-cli#7113
Changing to "@angular/cli": "1.2.4" fixed the problem. Make sure after changing from 1.0.0 ver to 1.2.4 to npm install before you ng build ... |
My version is: @angular/cli: 1.0.1 |
My original version is 1.2.1 and @angular/cli: 1.2.4 fixed the problem~ |
This worked for me
Step 3; |
same issue here, but using |
I could fix the issue by running the following commands:
|
Could someone told us about the source of this problem . because if i take my case , the command ng build --prod --aot was working fine . i don't change any thing on my project . and after a while . i have the same error ... updating the angular cli to the version 1.2.4 solve the problem for me . but still not getting what was the problem exactly ? . some help please . |
Note: Updating to angular-cli 1.2.4 solved the problem that started this thread for our instance of the installation. Application development done both on Mac and Windows. Of course, we also needed to do a fresh npm install. |
Thank you @beauxjames , but i found anoher problem when updating to the 1.2.6 . some module in my application are not working . so what you think should i do ? trying to solve this problem and keep the version 1.2.6 of angular or downgrade it to the old version and solve it with another way . |
@yassinechabli |
the problem was about a module (ngx-date-picker) that need to be updated also . |
below command solved my issue |
removing node_modules and running npm install worked for me. |
Sloved !! |
Sloved !! |
None of the solutions worked for me, because the issue was about memory. Maybe the command below could work for those who couldn't find a solution. This solved the issue in my case. node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod |
Could not resolve "./components/template/template.module" from "E:/vat_frontend/src/app/app.module.ts". |
import React, { Component } from 'react'; class App extends Component { render() {
} export default App; m geeting error of can anyone help me |
geeting error of can anyone help me |
import React, { Component } from 'react'; class App extends Component { } render() {
} export default App; |
Trying to build AOT but still unsuccessful! Even tried #7113 solution. But still error persists.kindly help Thanks! |
This command is 100% work for solving this problem. |
I have the same issue ERROR in ./src/main.ts ERROR in ./src/$$_gendir async ERROR in ./src/$$_gendir async I have tried with upgrading the @angular/cli latest version as well but I am not able to resolved that production issues. Please expert team help me. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I am getting
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
when I runng build --prod
, but if I run the commandng build --env=prod
I get success.Do we have any differences between these commands?
The text was updated successfully, but these errors were encountered: