Skip to content

Please backport PR #33285 to the 21.x branch. #33667

Description

@jkoervers

Command

add

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

PR #33285 fixes a bug that is currently affecting our project on Angular v21. Since the fix was merged into main (targeted for v22), projects staying on Angular v21 still experience this bug. I will support Angular v21 for years in our private library, so running ng add twice to make the schematic run is very unfortunate.

Impact

This fix is necessary for teams using Angular v21 who need to support v21 alongside of v22. Backporting this to a 21.x patch release would resolve the issue for active v21 builds.

Minimal Reproduction

Please see issue #33060 for the description.

Exception or Error


Your Environment

Angular CLI       : 21.2.6
Angular           : 21.2.6
Node.js           : 22.13.0
Package Manager   : npm 10.9.2
Operating System  : win32 x64

┌───────────────────────────────────┬───────────────────┬───────────────────┐
│ Package                           │ Installed Version │ Requested Version │
├───────────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/build-angular     │ 21.2.6            │ ^21.1.2           │
│ @angular/animations               │ 21.2.6            │ ^21.1.2           │
│ @angular/build                    │ 21.2.6            │ ^21.1.2           │
│ @angular/cdk                      │ 21.2.4            │ ^21.1.2           │
│ @angular/cli                      │ 21.2.6            │ ^21.1.2           │
│ @angular/common                   │ 21.2.6            │ ^21.1.2           │
│ @angular/compiler                 │ 21.2.6            │ ^21.1.2           │
│ @angular/compiler-cli             │ 21.2.6            │ ^21.1.2           │
│ @angular/core                     │ 21.2.6            │ ^21.1.2           │
│ @angular/forms                    │ 21.2.6            │ ^21.1.2           │
│ @angular/platform-browser         │ 21.2.6            │ ^21.1.2           │
│ @angular/platform-browser-dynamic │ 21.2.6            │ ^21.1.2           │
│ @angular/router                   │ 21.2.6            │ ^21.1.2           │
│ ng-packagr                        │ 21.2.2            │ ^21.2.2           │
│ rxjs                              │ 7.8.2             │ ~7.8.2            │
│ typescript                        │ 5.9.3             │ ~5.9.3            │
│ vitest                            │ 4.1.7             │ ^4.1.7            │
│ zone.js                           │ 0.15.1            │ ~0.15.0           │
└───────────────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions