angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

Open marciomsm opened this issue 9 years ago • 67 comments

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?

marciomsm avatar Jul 24 '17 18:07 marciomsm

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() {

return (
    <div className="image-upload">
    <View>
    <Image
     source={require('D:\ofc\firstapp\src\bmw.jpg')}
   />
   </View>

    </div>


);

} }

export default App;

m geeting error of ./src/practicee.js Module not found: Can't resolve 'D:ofc irstappsrcmw.jpg' in 'D:\ofc\firstapp\src'

can anyone help me

tayyab786 avatar Jun 21 '18 17:06 tayyab786

geeting error of ./src/practicee.js Module not found: Can't resolve 'D:ofc irstappsrc�mw.jpg' in 'D:\ofc\firstapp\src'

can anyone help me

tayyab786 avatar Jun 21 '18 17:06 tayyab786

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() {

return (
    <div className="image-upload">
    <View>
    <Image
     source={require('D:\ofc\firstapp\src\bmw.jpg')}
   />
   </View>

    </div>


);

} }

export default App;

tayyab786 avatar Jun 21 '18 17:06 tayyab786

Trying to build AOT but still unsuccessful! Even tried #7113 solution. But still error persists.kindly help Thanks! @filipesilva @Brocco

current cli version installed: screenshot_1

Error screen shot screenshot_2

KhizerRehan avatar Jun 24 '18 00:06 KhizerRehan

This command is 100% work for solving this problem. npm install [email protected]

ssjoy76 avatar Sep 25 '18 19:09 ssjoy76

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.

rameshpraja avatar Oct 02 '18 12:10 rameshpraja

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.