You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' #7125
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, but if I run the command ng build --env=prod I get success.
Do we have any differences between these commands?
updating to @angular/cli 1.2.4 and the other packages to the latest version solved the issue for me.
Reacted by Hiren Parekh, Jason Simpson, Raghav-Sao, Hadrien TOMA, boonkahming, Damian Wróblewski, Andrey Patseiko, cristianqr, Asiel Leal Celdeiro, jamesboh and 12 more
Reacted by Damian Wróblewski, Hardik Pithva, Asiel Leal Celdeiro, zhangchengtest, ingcarlosmoya, Vigneswaran and Amol Meher
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.
Sloved !!
I had this issue when i was trying the execute ng build -aot command.
problem slove for me when i changed the version of "@angular/cli": "1.2.0" to "@angular/cli": "1.3.0",
Sloved !!
I had this issue when i was trying the execute ng build -prod command.
Problem solved by updating the version of "@angular/cli": "1.0.0" to "@angular/cli": "1.3.0".
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.
import React, { Component } from 'react';
import logo from './logo.svg';
import './image.css';
import Dropdown from 'react-dropdown';
import axios from 'axios';
import { AppRegistry, View, Image,Text, } from 'react-native';
I have the same issue
Angular CLI version : 1.0.0
angular version : 4
node : v8.11.3
When I fired ng build --prod then throwing the below error
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir/app/routes/home/home.module.ngfactory.ts' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir/app/routes/loan/loan.module.ngfactory.ts' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
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.
angular-automatic-lock-bot commented on Sep 8, 2019
Activity
ajalmaguer commentedon Jul 24, 2017
Happens for me too. These are the versions of my project:
marciomsm commentedon Jul 24, 2017
I solved it setting the
zone.jsversion to0.8.14. I don't know if we have an issue on Angular-CLI or on zone.js.marius-oprea commentedon Jul 24, 2017
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.
bcravens commentedon Jul 24, 2017
@marius-oprea same thing just happened to me.
mattrichard commentedon Jul 24, 2017
I'm getting the same error too. Updating zone.js did not work for me.
jh-code commentedon Jul 24, 2017
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.
bcravens commentedon Jul 24, 2017
We eventually solved it by mass updating our node packages. Not sure which one solved the problem, wasn't zone.js though.
marius-oprea commentedon Jul 24, 2017
updating to @angular/cli 1.2.4 and the other packages to the latest version solved the issue for me.
marciomsm commentedon Jul 24, 2017
Change your package.json to
zone.js: 0.8.14. Deletenode_modulesfolder and runnpm installagain.EricABC commentedon Jul 24, 2017
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.
joseph-mcallister commentedon Jul 24, 2017
None of the package updating worked for me but adding enhanced-resolve: 3.3.0 did. See #4551
tianyuanzhonglu commentedon Jul 25, 2017
@angular/cli: 1.2.4 fix the problem
41 remaining items
manishit56 commentedon Sep 22, 2017
below command solved my issue
npm install enhanced-resolve@3.3.0
fix deploy error
justin48 commentedon Oct 18, 2017
removing node_modules and running npm install worked for me.
devssharma commentedon Nov 11, 2017
Sloved !!
I had this issue when i was trying the execute ng build -aot command.
problem slove for me when i changed the version of "@angular/cli": "1.2.0" to "@angular/cli": "1.3.0",
imichelakos commentedon Nov 14, 2017
Sloved !!
I had this issue when i was trying the execute ng build -prod command.
Problem solved by updating the version of "@angular/cli": "1.0.0" to "@angular/cli": "1.3.0".
scharlo commentedon Feb 1, 2018
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
bharath005 commentedon Apr 5, 2018
Could not resolve "./components/template/template.module" from "E:/vat_frontend/src/app/app.module.ts".
tayyab786 commentedon Jun 21, 2018
import React, { Component } from 'react';
import logo from './logo.svg';
import './image.css';
import Dropdown from 'react-dropdown';
import axios from 'axios';
import { AppRegistry, View, Image,Text, } from 'react-native';
// import 'react-dropdown/style.css';
class App extends Component {
state=
{
selectedFile:null
}
fileSelectHandler=event=>{
// console.log(event.target.files[0]);
this.setState({
selectedFile:event.target.files[0]
})
// fileUploadHandler=() =>
// {
// axios.post('')
//
// }
}
render() {
}
}
export default App;
m geeting error of
./src/practicee.js
Module not found: Can't resolve 'D:ofcirstappsrc�mw.jpg' in 'D:\ofc\firstapp\src'
can anyone help me
tayyab786 commentedon Jun 21, 2018
geeting error of
./src/practicee.js
Module not found: Can't resolve 'D:ofcirstappsrc�mw.jpg' in 'D:\ofc\firstapp\src'
can anyone help me
tayyab786 commentedon Jun 21, 2018
import React, { Component } from 'react';
import logo from './logo.svg';
import './image.css';
import Dropdown from 'react-dropdown';
import axios from 'axios';
import { AppRegistry, View, Image,Text, } from 'react-native';
class App extends Component {
state=
{
selectedFile:null
}
fileSelectHandler=event=>{
this.setState({
selectedFile:event.target.files[0]
})
}
render() {
}
}
export default App;
KhizerRehan commentedon Jun 24, 2018
Trying to build AOT but still unsuccessful! Even tried #7113 solution. But still error persists.kindly help Thanks!
@filipesilva @Brocco
current cli version installed:

Error screen shot

ssjoy76 commentedon Sep 25, 2018
This command is 100% work for solving this problem.
npm install enhanced-resolve@3.3.0
rameshpraja commentedon Oct 2, 2018
I have the same issue
Angular CLI version : 1.0.0
angular version : 4
node : v8.11.3
When I fired ng build --prod then throwing the below error
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir/app/routes/home/home.module.ngfactory.ts' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir/app/routes/loan/loan.module.ngfactory.ts' in '/home/user2/Project/test/streetworkapp/material/loan_calculator/src/$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
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.
angular-automatic-lock-bot commentedon Sep 8, 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.