Title: NG0912 error after migrating (to 16) multiple components with no selector · Issue #50158 · angular/angular · GitHub
Open Graph Title: NG0912 error after migrating (to 16) multiple components with no selector · Issue #50158 · angular/angular
X Title: NG0912 error after migrating (to 16) multiple components with no selector · Issue #50158 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Components generated with the CLI (pre 16.x or 16.x) using --skip-selector result in the browser displaying NG0912 error, claiming that mul...
Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Components generated with the CLI (pre 16.x or 16.x) using --skip-selector result in the browser di...
X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Components generated with the CLI (pre 16.x or 16.x) using --skip-selector result in the browser di...
Opengraph URL: https://github.com/angular/angular/issues/50158
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NG0912 error after migrating (to 16) multiple components with no selector","articleBody":"### Which @angular/* package(s) are the source of the bug?\r\n\r\ncore\r\n\r\n### Is this a regression?\r\n\r\nYes\r\n\r\n### Description\r\n\r\nComponents generated with the CLI (pre 16.x or 16.x) using `--skip-selector` result in the browser displaying NG0912 error, claiming that multiple of my components have colliding selector `ng-component`, when using Angular 16. This error is **not** present in at least 13, 14, and 15.\r\n\r\nThe components in question all look like this:\r\n```typescript\r\nimport { Component } from '@angular/core';\r\n@Component({\r\n templateUrl: './foo-with-no-selector.component.html',\r\n styleUrls: ['./foo-with-no-selector.component.scss'],\r\n})\r\nexport class FooWithNoSelector{ ... some stuff }\r\n@Component({\r\n templateUrl: './bar-with-no-selector.component.html',\r\n styleUrls: ['./bar-with-no-selector.component.scss'],\r\n})\r\nexport class BarWithNoSelector{ ... some stuff }\r\n```\r\nThese components are used only in Routing (or manually created as dialogs using material).\r\nAfaik the convention for route only components was to omit `selector`. Is this change intentional or is it documented somewhere?\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\n_No response_\r\n\r\n### Please provide the exception or error you saw\r\n\r\n```true\r\nNG0912: Component ID generation collision detected. Components 'FooWithNoSelector' and 'BarWithNoSelector' with selector 'ng-component' 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\r\n```\r\n\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\nAngular CLI: 16.0.0\r\nNode: 18.16.0\r\nPackage Manager: npm 9.6.4\r\nOS: win32 x64\r\n\r\nAngular: 16.0.0\r\n... animations, cdk, cli, common, compiler, compiler-cli, core\r\n... forms, material, material-luxon-adapter, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1600.0\r\n@angular-devkit/build-angular 16.0.0\r\n@angular-devkit/core 16.0.0\r\n@angular-devkit/schematics 16.0.0\r\n@schematics/angular 16.0.0\r\nrxjs 7.8.1\r\ntypescript 4.9.5\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\n_No response_","author":{"url":"https://github.com/alexaka1","@type":"Person","name":"alexaka1"},"datePublished":"2023-05-05T10:28:40Z","url":"https://github.com/angular/angular/issues/50158"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2d4fac1c-c533-1fbd-15c9-80007e6db5c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5C8:240CD1:1803EEC:1E879C6:6B013FD8 |
| html-safe-nonce | e03de27f7cec64ceca05bea488a11394c5d066d789de1111a5a6ad76ab981200 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUM4OjI0MENEMToxODAzRUVDOjFFODc5QzY6NkIwMTNGRDgiLCJ2aXNpdG9yX2lkIjoiOTE0NDgxNTc5NDAyMTAyMzcwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2927b762d97d99a9b3013bd071f16654074e4963f22cc9c010740ca88998160c |
| hovercard-subject-tag | issue:1697381885 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/50158/issue_layout |
| twitter:image | https://opengraph.githubassets.com/26fa5f9e58dccaf863156042b8931fcc151a013d893d17a7d5fd906a7eee98e5/angular/angular/issues/50158 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/26fa5f9e58dccaf863156042b8931fcc151a013d893d17a7d5fd906a7eee98e5/angular/angular/issues/50158 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Components generated with the CLI (pre 16.x or 16.x) using --skip-selector result in the browser di... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexaka1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width