angular icon indicating copy to clipboard operation
angular copied to clipboard

Unable to execute ng g @angular/core:control-flow on V20

Open nikhild64 opened this issue 8 months ago • 4 comments

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

Tried executing ng generate @angular/core:control-flow on angular CLI and i get the error

Schematic "control-flow" not found in collection "@angular/core".

Tried on newly created v20 project and even updating older from v19 to v20

Image

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Schematic "control-flow" not found in collection "@angular/core".

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 20.0.0
Node: 22.2.0
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 20.0.0
... build, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.0
@angular-devkit/core         20.0.0
@angular-devkit/schematics   20.0.0
@schematics/angular          20.0.0
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else?

No response

nikhild64 avatar May 29 '25 04:05 nikhild64

On checking i found , schematic was moved from collections.json to migration.json in core but with optional flag true and now when use wants to execute this on later stage it wont be possible Changes were done in https://github.com/angular/angular/pull/60492

Solution i would suggest is keep it in collections.json as well so this can be executed on CLI on later stage also

nikhild64 avatar May 29 '25 05:05 nikhild64

The control flow migration schematic can be re-run with ng update @angular/core --migrate-only --from=19 --to=20

JeanMeche avatar May 29 '25 08:05 JeanMeche

The temporary CLI v20 which is installed for previous versions cannot find the new name

> ng update @angular/core --name=control-flow-migration
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 20.0.0 to perform the update.
Using package manager: npm
Collecting installed dependencies...
Found 89 dependencies.
Cannot find migration 'control-flow-migration' in '@angular/core'.

Repro https://stackblitz.com/edit/stackblitz-starters-dpwe5a2h?file=src%2Fmain.ts

msmallest avatar May 30 '25 20:05 msmallest

ng update @angular/core --name=control-flow-migration can only be run on a v20 project.

This is to re-run the schematics on a project that has already been updated to v20.

Also with #61773 we intend to bring back the previous ng generate schematics.

JeanMeche avatar May 30 '25 20:05 JeanMeche

We can close this Issue PR got merged.

JeevanMahesha avatar Jun 11 '25 05:06 JeevanMahesha

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.