I get this below error after upgrading my angular-cli
ERROR in Template parse errors:
Can't bind to 'index' since it isn't a known property of 'tag'. ("own)="handleKeydown($event, item)"
(onTagEdited)="onTagEdited.emit(item)"
[ERROR ->][index]="i"
[attr.tabindex]="readonly ? -1 : 0"
[class.readonly]="readonly""): TagInputComponent@16:13
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\xxxx\yyyy\eeeee\eeee\src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
This error happens when i run ng build --prod and works fine when i run ng build without any parameters,
When you run the ng build in angular 2, latest angular-cli automatically runs with --aot parameter (ahead of time compilation), so it is trying to optimize your code. You are having a package that is not yet compatible for optimizing. So you need update to your packages. Most probably the packages that has **forRoot()** in your app.module.ts
I recommend to update all packages.
Easy way to update your package is to use ncu npm package as in below, which i got it from How do I correctly upgrade angular 2 (npm) to the latest version?
Install
npm install -g npm-check-updates
Usage
ncu for display
ncu -u for re-writing your package.json
and run npm install to update your packages
If above did not work, you might need to update your code for aot compliance. Refer this url below to make changes in your code. https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad
Use:
ng build --env=prod
instead of:
ng build --prod
I had the same issue and how I ended up resolving it was: Delete the enhanced-resolve module from node_modules and then run
npm install enhanced-resolve@3.3.0
After that aot builds worked as expected...