+
Skip to content

NG0912: Component ID generation collision detected warning #844

@andrejsipka

Description

@andrejsipka

Please provide the environment you discovered this bug in.

Link to repo:
https://github.com/andrejsipka/portfolio-poc

Which area/package is the issue in?

Don't know / other

Description

I'm getting warning that there is collision detected. Each time I will make change in the component then after saving changes the warning will occur for that specific component. Each one of these components has a selector. Here is an example:

@Component({ selector: 'app-home', standalone: true, imports: [ CommonModule, ProjectCardComponent, PostItemComponent, RouterLink ], template: '...' })

Warning will not show up on initial load tho.

Please provide the exception or error you saw

NG0912: Component ID generation collision detected. Components 'HomeComponent' and 'HomeComponent' with selector 'app-home' 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.io/errors/NG0912

Other information

Found similar issue but selector wasn't included in the components:
angular/angular#50158

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载