• Register
0 votes

Problem :

I face this following 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)"


             [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


Above error happens only when I run the ng build --prod and works fine when I run the ng build without the parameters

7 5 2
3,870 points

1 Answer

0 votes

Solution :

When you run a ng build in the angular 2, latest angular-cli automatically runs with --aot parameter (ahead of a time compilation), so it is trying to optimize the code. You are having the package which is not yet compatible for the optimizing. So you need to update the packages. Most probably your packages that has **forRoot()** in the app.module.ts

I recommend you to update all packages.

Easy way to update your package is to use the ncu npm package as in below,

Install it:

npm install -g npm-check-updates

Use it:

ncu for the display

ncu -u for the re-writing your package.json

and run npm install to update the packages

If above did not work, for you then you might need to update your code for aot compliance.

9 7 4
38,600 points

Related questions

1 vote
1 answer 34 views
Problem: I have gained fundamental knowledge on Angular2. I am taking help of online tutorials to learn Angular2. I am trying to create the angular 2 App with the angular cli I have written below command in my cmd: npm install angular-cli -g After above command I am ... an error . I am unable to debug above error. I need Angular2 expert who can help me in fixing above Angular2 error for me.
asked Jun 5 Martin K 6.6k points
0 votes
1 answer 62 views
Problem: I was trying to start the ionic 3 but if I try to run the command 'ionic cordova run android' then I was facing below error. I tried many ways to fix this problem but I was unable to fix it: > cordova run android [13:30:46]  lint finished ... are my System details: Node       : v6.11.0 OS         : Windows 7 Xcode      : not installed ios-deploy : not installed ios-sim    : not installed
asked Aug 15 Raphael Pacheco 4.9k points
1 vote
2 answers 172 views
Problem : I am very new to Ionic, I have recently started working on Ionic but I am facing below error: Runtime Error Uncaught (in promise): Error: Module build failed: Error: ENOENT: no such file or directory, open '/Users/stewart/Development/ionic/theWhoZoo/src/pages ... say they do match. import { MyRatingModel } from '../model/myratingModel'; How can I fix above error need Ionic expert help.
asked Apr 22 stewart 4k points
0 votes
1 answer 178 views
Problem: I am facing following error if I tried to use a MatToolBar in my angular app. In browser I receive: Uncaught TypeError: Object(...) is not a function I also receive below warnings in my console: WARNING in ./node_modules/@angular/cdk/esm5/text-field.es5.js ... /cdk/esm5/a11y.es5.js 2324:206-214 "export 'ɵɵinject' was not found in '@angular/core' Kindly guide me in resolving above errors.
asked Aug 18 Raphael Pacheco 4.9k points