alxhub / io17

106 stars 21 forks source link

unable to run `./run.sh` with error: `Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'` #21

Open jbastias opened 7 years ago

jbastias commented 7 years ago

Great talk but disappointed when I was not able to run the app 😢 .

The full error I got after cloning and npm installing was:

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/code/experiments/io17/src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts

ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/code/experiments/io17/src/$$_gendir/app/home/home-route.module.ngfactory.ts' in '/code/experiments/io17/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 '/code/experiments/io17/src/$$_gendir/app/cart/cart-route.module.ngfactory.ts' in '/code/experiments/io17/src/$$_gendir'
 @ ./src/$$_gendir async
 @ ./~/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.tsERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/code/experiments/io17/src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts

ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/code/experiments/io17/src/$$_gendir/app/home/home-route.module.ngfactory.ts' in '/code/experiments/io17/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 '/code/experiments/io17/src/$$_gendir/app/cart/cart-route.module.ngfactory.ts' in '/code/experiments/io17/src/$$_gendir'
 @ ./src/$$_gendir async
 @ ./~/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.ts

I happened to find this while search for a fix.

I was able to continue on changing the build command:

# gave the error
ng build --prod 

# no error
ng build --env=prod