-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Description
Hello guys, I am working on on upgrading a couple of projects to Angular 10 from Angular 9 and I am going through the steps in the update.angular.io guide, however I am having an issue with one of the projects. (I am using ng update)
The first project was upgraded successfully by upgrading to the latest Angular 8 version first, then upgrading to Angular 9 and then to Angular 10.
The upgrade of the second project however seemed incomplete, because not all of the same migrations were executed as for the first one.
I am aware of this #18027, however I have not received any errors and I updated the project step by step without skipping major versions.
Update log
After executing ng update @angular/core @angular/cli, the following output was present:
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 44 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-ng-packagr" has an incompatible peer dependency to "tsickle" (requires "~0.38.0", would install "0.39.0")
Package "@angular/cdk" has an incompatible peer dependency to "tslib" (requires "^1.9.0", would install "2.0.0").
Package "tsickle" has an incompatible peer dependency to "typescript" (requires "~3.8.2", would install "3.9.6")
Since tsickle does not have typescript 3.9.x as a peer dependency yet (should be resolved by this issue I guess: angular/tsickle#1161 ), I ignored that warning. I ignored the angular/cdk warning as well, because upgrading the angular/material package (after the core and cli packages) should update the cdk to version 10 as well. Eventually I executed the ng update with the --force flag.
This is the final output, in which you will notice that only the package.json file is updated and the additional migrations to the tsconfig.json, tsconfig.lib.prod.json and the creation of the tsconfig.base.json are missing, but no error is thrown.
ng update @angular/core @angular/cli --force
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 44 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-ng-packagr" has an incompatible peer dependency to "tsickle" (requires "~0.38.0", would install "0.39.0")
Package "@angular/cdk" has an incompatible peer dependency to "tslib" (requires "^1.9.0", would install "2.0.0").
Package "tsickle" has an incompatible peer dependency to "typescript" (requires "~3.8.2", would install "3.9.6")
Updating package.json with dependency @angular/cli @ "10.0.1" (was "9.1.10")...
Updating package.json with dependency @angular/core @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular-devkit/build-ng-packagr @ "0.1000.1" (was "0.901.10")...
Updating package.json with dependency ng-packagr @ "10.0.0" (was "9.1.5")...
Updating package.json with dependency @angular/language-service @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/compiler-cli @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/common @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/animations @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/elements @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/platform-browser @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/compiler @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular/forms @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency tslib @ "2.0.0" (was "1.10.0")...
Updating package.json with dependency @angular/router @ "10.0.2" (was "9.1.11")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.1000.1" (was "0.901.10")...
Updating package.json with dependency typescript @ "3.9.6" (was "3.8.3")...
UPDATE package.json (2870 bytes)
✔ Packages installed successfully.
** Executing migrations of package '@angular/core' **
❯ Missing @Injectable and incomplete provider definition migration.
As of Angular 9, enforcement of @Injectable decorators for DI is a bit stricter and incomplete provider definitions behave differently.
Read more about this here: https://v9.angular.io/guide/migration-injectable
Migration completed.
❯ ModuleWithProviders migration.
As of Angular 10, the ModuleWithProviders type requires a generic.
This migration adds the generic where it is missing.
Read more about this here: https://v10.angular.io/guide/migration-module-with-providers
Migration completed.
❯ Undecorated classes with Angular features migration.
In version 10, classes that use Angular features and do not have an Angular decorator are no longer supported.
Issue
The end result is a very short upgrade log and it seems not everything was migrated, which includes the missing tsconfig.base.json. What could be the reason for that and is it essential for all Angular 10+ projects to have the new structure, that these tsconfig migrations provide? The project builds and runs successfully though.