Skip to content

19.1.X NG0912: Incorrect Component ID collision warning #29408

@Ruisi-Lu

Description

@Ruisi-Lu

Command

serve

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

"NG0912: Component ID generation collision detected" is being thrown incorrectly despite all component selectors and IDs being unique.

Minimal Reproduction

  1. Create a new Angular project using version 19.1.x
  2. Run dev server
  3. Continuously modify the app.component.html or the template of any other component.
  4. Observe the terminal for the NG0912 warning. It appears sporadically during rebuilds triggered by these template modifications.

Exception or Error

NG0912: Component ID generation collision detected. Components '_AppComponent' and '_AppComponent' with selector 'app-root' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID. Find more at https://angular.dev/errors/NG0912

Your Environment

Enabled SSR

Angular CLI: 19.1.2
Node: 20.18.1
Package Manager: pnpm 10.0.0
OS: win32 x64

Angular: 19.1.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.2
@angular-devkit/build-angular   19.1.2
@angular-devkit/core            19.1.2
@angular-devkit/schematics      19.1.2
@angular/cli                    19.1.2
@angular/ssr                    19.1.2
@schematics/angular             19.1.2
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else relevant?

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions