Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Ruisi-Lu opened this issue Jan 20, 2025 · 4 comments
Closed
1 task done

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

Ruisi-Lu opened this issue Jan 20, 2025 · 4 comments
Assignees

Comments

@Ruisi-Lu
Copy link

Ruisi-Lu commented Jan 20, 2025

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

@JoostK JoostK transferred this issue from angular/angular-cli Jan 20, 2025
@ngbot ngbot bot modified the milestone: needsTriage Jan 20, 2025
@alan-agius4 alan-agius4 transferred this issue from angular/angular Jan 20, 2025
@alan-agius4

This comment has been minimized.

@alan-agius4

This comment has been minimized.

@alan-agius4 alan-agius4 reopened this Jan 20, 2025
@alan-agius4 alan-agius4 added type: bug/fix severity2: inconvenient severity5: regression requires: TGP This PR requires a passing TGP before merging is allowed area: @angular/build angular/build:dev-server freq1: low Only reported by a handful of users who observe it rarely and removed severity5: regression requires: TGP This PR requires a passing TGP before merging is allowed labels Jan 20, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 20, 2025
This warning was mistakenly triggered when making component changes, even outside of Hot Module Replacement (HMR).

Closes angular#29408
@alan-agius4 alan-agius4 self-assigned this Jan 20, 2025
@alan-agius4
Copy link
Collaborator

Closed via angular/angular#59625

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.