Add report duplicate selectors as NG8023 compile-time diagnostic#67346
Open
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
Open
Add report duplicate selectors as NG8023 compile-time diagnostic#67346SkyZeroZx wants to merge 2 commits intoangular:mainfrom
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
Conversation
Remove NG0300 runtime error to align with compile-time diagnostics. The error will now be reported during compilation instead of at runtime.
…duplicate selectors Add NG8023 extended diagnostic to report duplicate component selectors during compilation. This replaces the former NG0300 runtime error, ensuring the failure occurs at build time instead of runtime. Closes angular#48377
SkyZeroZx
commented
Feb 27, 2026
| // (undocumented) | ||
| MISSING_ZONEJS = 908, | ||
| // (undocumented) | ||
| MULTIPLE_COMPONENTS_MATCH = -300, |
Contributor
Author
There was a problem hiding this comment.
I’m wondering whether we should remove it from the documentation or add a new entry as a compilation error.
JeanMeche
reviewed
Feb 27, 2026
| INVALID_APP_ID = 211, | ||
|
|
||
| // Template Errors | ||
| MULTIPLE_COMPONENTS_MATCH = -300, |
Member
There was a problem hiding this comment.
If we remove it. Can you please add a placeholder comment. We don't want to reassign errors codes in the future.
JeanMeche
reviewed
Feb 27, 2026
Comment on lines
-483
to
-485
| if (matches.length && isComponentDef(matches[0])) { | ||
| throwMultipleComponentError(tNode, matches.find(isComponentDef)!.type, def.type); | ||
| } |
Member
There was a problem hiding this comment.
Actually we might want to keep it because of JIT compilation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add NG8023 extended diagnostic to report duplicate component selectors
during compilation.
This replaces the former NG0300 runtime error, ensuring the failure
occurs at build time instead of runtime.
Closes #48377
What is the current behavior?
This only throws an error at runtime.
What is the new behavior?
Now at compile time we will get something like the following error
Other information
Could we perhaps consider this a breaking change, since the error will now always be thrown, given that it only ran in development mode when it was NG0300?