question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

update migration to remove solution style tsconfig is not run

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No

Description

Running ng update @angular/cli to update to v10.1.0 from v10.0.8 does not run the migration to remove solution style tsconfigs.

πŸ”¬ Minimal Reproduction

  1. ng update @angular/cli
Your global Angular CLI version (10.1.0) is greater than your local
version (10.0.8). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
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 54 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.1001.0" (was "0.1000.8")...
    Updating package.json with dependency @angular/cli @ "10.1.0" (was "10.0.8")...
UPDATE package.json (3764 bytes)
βœ” Packages installed successfully.
splaktar:xlts.dev splaktar$ npm i
npm WARN @angular/fire@6.0.0 requires a peer of @angular/common@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@6.0.0 requires a peer of @angular/core@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@6.0.0 requires a peer of @angular/platform-browser@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@6.0.0 requires a peer of @angular/platform-browser-dynamic@^9.0.0 but none is installed. You must install peer dependencies yourself.

removed 4 packages and audited 2828 packages in 12.241s

126 packages are looking for funding
  run `npm fund` for details

found 4 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
  1. Notice that there are no migrations run
  2. Check that tsconfig.base.json still exists

πŸ”₯ Exception or Error

None

🌍 Your Environment

Before


Angular CLI: 10.0.8
Node: 12.16.1
OS: darwin x64

Angular: 10.1.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.8
@angular-devkit/build-angular     0.1000.8
@angular-devkit/build-optimizer   0.1000.8
@angular-devkit/build-webpack     0.1000.8
@angular-devkit/core              9.1.12
@angular-devkit/schematics        9.1.12
@angular/cdk                      10.1.3
@angular/cli                      10.0.8
@angular/fire                     6.0.0
@angular/material                 10.1.3
@ngtools/webpack                  10.0.8
@schematics/angular               9.1.12
@schematics/update                0.1000.8
rxjs                              6.6.2
typescript                        3.9.7
webpack                           4.43.0

After


Angular CLI: 10.1.0
Node: 12.16.1
OS: darwin x64

Angular: 10.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1001.0 (cli-only)
@angular-devkit/build-angular     0.1001.0
@angular-devkit/build-optimizer   0.1001.0
@angular-devkit/build-webpack     0.1001.0
@angular-devkit/core              9.1.12
@angular-devkit/schematics        9.1.12
@angular/cdk                      10.1.3
@angular/fire                     6.0.0
@angular/material                 10.1.3
@ngtools/webpack                  10.1.0
@schematics/angular               9.1.12
@schematics/update                0.1001.0
rxjs                              6.6.2
typescript                        4.0.2
webpack                           4.44.1

Anything else relevant? I’m not sure why it’s showing 9.1.12 for @angular-devkit/core, @angular-devkit/schematics, and @schematics/angular.

Here’s the output of npm ls @angular-devkit/core:

β”œβ”€β”¬ @angular-devkit/architect@0.1000.8
β”‚ └── @angular-devkit/core@10.0.8 
β”œβ”€β”¬ @angular-devkit/build-angular@0.1000.8
β”‚ β”œβ”€β”¬ @angular-devkit/architect@0.1000.8
β”‚ β”‚ └── @angular-devkit/core@10.0.8  deduped
β”‚ β”œβ”€β”¬ @angular-devkit/build-webpack@0.1000.8
β”‚ β”‚ β”œβ”€β”¬ @angular-devkit/architect@0.1000.8
β”‚ β”‚ β”‚ └── @angular-devkit/core@10.0.8  deduped
β”‚ β”‚ └── @angular-devkit/core@10.0.8 
β”‚ β”œβ”€β”€ @angular-devkit/core@10.0.8 
β”‚ └─┬ @ngtools/webpack@10.0.8
β”‚   └── @angular-devkit/core@10.0.8 
β”œβ”€β”¬ @angular/cli@10.0.8
β”‚ β”œβ”€β”¬ @angular-devkit/architect@0.1000.8
β”‚ β”‚ └── @angular-devkit/core@10.0.8  deduped
β”‚ β”œβ”€β”€ @angular-devkit/core@10.0.8 
β”‚ β”œβ”€β”¬ @angular-devkit/schematics@10.0.8
β”‚ β”‚ └── @angular-devkit/core@10.0.8  deduped
β”‚ β”œβ”€β”¬ @schematics/angular@10.0.8
β”‚ β”‚ └── @angular-devkit/core@10.0.8  deduped
β”‚ └─┬ @schematics/update@0.1000.8
β”‚   β”œβ”€β”€ @angular-devkit/core@10.0.8 
β”‚   └─┬ @angular-devkit/schematics@10.0.8
β”‚     └── @angular-devkit/core@10.0.8  deduped
β”œβ”€β”¬ @schuchard/prettier@3.1.0
β”‚ β”œβ”€β”€ @angular-devkit/core@7.3.9 
β”‚ └─┬ @angular-devkit/schematics@7.3.9
β”‚   └── @angular-devkit/core@7.3.9  deduped
└─┬ @scullyio/init@1.0.0-beta.0
  β”œβ”€β”€ @angular-devkit/core@9.1.12 
  β”œβ”€β”¬ @angular-devkit/schematics@9.1.12
  β”‚ └── @angular-devkit/core@9.1.12  deduped
  β”œβ”€β”¬ @schematics/angular@9.1.12
  β”‚ └── @angular-devkit/core@9.1.12  deduped
  └─┬ schematics-utilities@2.0.2
    β”œβ”€β”€ @angular-devkit/core@8.3.29 
    β”œβ”€β”¬ @angular-devkit/schematics@8.3.29
    β”‚ └── @angular-devkit/core@8.3.29  deduped
    β”œβ”€β”¬ @schematics/angular@8.3.29
    β”‚ └── @angular-devkit/core@8.3.29  deduped
    └─┬ @schematics/update@0.803.29
      └── @angular-devkit/core@8.3.29  deduped

Here’s the output of npm ls @schematics/angular:

β”œβ”€β”¬ @angular/cli@10.0.8
β”‚ └── @schematics/angular@10.0.8 
└─┬ @scullyio/init@1.0.0-beta.0
  β”œβ”€β”€ @schematics/angular@9.1.12 
  └─┬ schematics-utilities@2.0.2
    └── @schematics/angular@8.3.29 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
MrPcommented, Dec 18, 2020

I ran the following command and it worked out:

ng update @angular/cli --from=10.0.0 --to=10.1.3 --migrateOnly=true

As I forgot to use ng update after updating my packages with npm-check-updates to latest CLI version (v10.1.3).

Thanks for this, it worked great for me with Angular 11.

If anybody like me missed the migration back to non-solution-style tsconfig during v10, then updated to 11, then tried to migrate to eslint and was confrontend with an error message telling you off for still having around a tsconfig.base.json, then this solution is also for you. Just to be explicit, I ran the command above as is, even though I was at v11 of everything already.

Oh, and that was after manually installing @angular-devkit/schematics, but I didn’t test without it, so I don’t know if that is part of the solution as well.

2reactions
alan-agius4commented, Nov 23, 2020

Would you suggest that all schematic library authors out there start doing checks like this? Is that even something that a library would be able to evaluate at runtime? or would this have to be done in the CLI?

Typically 3rd party users using schematics will list their dependencies explicitly and in many cases users if they are using @schematics/angular, @angular-devkit/schematics etc…

Side note: typically 3rd party libraries shouldn’t dependent on @schematics/angular as most of the APIs in that package are private and not meant to be used by downstream users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9 to 10 solution style tsconfig.json should be created ...
The migration to create tsconfig.base.json was removed because it caused unexcepted bugs. You can read about it here:Β ...
Read more >
TypeScript configuration - Angular
Browsers can't execute TypeScript directly. Typescript must be "transpiled" into JavaScript using the tsc compiler, which requires some configuration.
Read more >
Documentation - TypeScript 3.9
you have a larger project and new errors have appeared in code with no clear owner; you are in the middle of an...
Read more >
What is New in Angular 10? - Medium
So, we jumped into the details of what changed and how to migrate. ... Earlier versions of TypeScript does not support "solution style",Β ......
Read more >
What's new in Angular CLI 15.0? - Ninja Squad
json file if you need to. A migration will run and simplify this file in your project (but not remove it, although you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found