Angular v9 to v10 update error `Cannot add the "@Injectable" decorator to providers which don't have that decorator set.`

Viewed 520

I'm updating an Angular library version from v9.1.13 to v10.2.5, but getting the following error: Migration failed: Could not find any tsconfig file. Cannot add the "@Injectable" decorator to providers which don't have that decorator set.

enter image description here

I searched for Angular resources mentioned along with error: https://v9.angular.io/guide/migration-injectable, but it didn't help much as library is already following the required structure.

Similar kind of question is still unanswered on SO: Angular version update giving an error - Migration failed: Could not find any tsconfig file

If anyone has already gone through alike problem and found the solution, help will be really appreciated.

1 Answers

Did you update Angular 9 to Angular 10 like this below?

ng update @angular/core@10 @angular/cli@10 --force 

If above approach does not work try disabling Ivy engine in tsconfig.json file:

In case if you are using some outdated package which is not compatible with Ivy.

"angularCompilerOptions": {"enableIvy": false}
Related