ketan vaidya
ketan vaidya

Reputation: 49

Update from Angular 7 to Angular 9 leads to an error

enter image description hereThe project is compiling successfully but I am getting this error:

core.js:24350 Uncaught TypeError: Cannot read property 'id' of undefined

Upvotes: 0

Views: 1052

Answers (3)

Waqar Naeem
Waqar Naeem

Reputation: 1173

I was facing the update issue, please follow the link calmly, How to update from 7 to 9

ng update @angular/cli@7 @angular/core@7

then,

ng update @angular/cli@8 @angular/core@8

lastly

ng update @angular/cli@9 @angular/core@9

Upvotes: 0

Otman Yazigh
Otman Yazigh

Reputation: 241

You should first update your Angular project from v7 to the latest Angular 8 patch release, next, update to Angular 9 using the following command:

ng update @angular/cli @angular/core

These are the steps:

Step 1 - Preparing and Navigating to your Project Step 2 - Identifying the Used Angular Version in The Project Step 3 - Identifying how To Upgrade Step 4 - Updating from Angular 7 to v8 Step 5 - Updating from Angular v8.2.3 to The Latest Angular 9 Version Step 6 - Testing the App

You can follow this tutorial for an example.

Upvotes: 0

Kyler Johnson
Kyler Johnson

Reputation: 2194

It is impossible to know the solution to your problem with the information you provided. If you input your versions on the Angular Update Guide, it will give you a list of things you need to do to upgrade successfully.

Be advised, it is a good idea to upgrade one version at a time. In other words, in going from Angular 7 to Angular 9, you should first upgrade to Angular 8. Only after ensuring that everything works as expected should you upgrade to Angular 9. This will help narrow down any errors you might be receiving.

Upvotes: 2

Related Questions