angular: Update error message for an unknown tag in standalone components
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Currently the error for unknown element tags looks like follows:
src/app/app.component.ts:7:14 - error NG8001: 'admin-s' is not a known element:
1. If 'admin-s' is an Angular component, then verify that it is part of this module.
2. If 'admin-s' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
7 template: '<admin-s></admin-s>',
This error message needs to be updated for standalone components to:
- mention
@Component.imports
/ `@Component.schemas’ - not mention NgModule
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (11 by maintainers)
Commits related to this issue
- feat(compiler-cli): update unknown tag in aot standalone component update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone component so tha... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- feat(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so tha... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- feat(compiler-cli): update unknown tag error for aot standalone components update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone componen... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- feat(compiler-cli): update unknown tag error for aot standalone components update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone componen... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- feat(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so tha... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(compiler-cli): update unknown tag error for aot standalone components update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone component... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone component so that... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(compiler-cli): update unknown tag error for aot standalone components update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone component... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(compiler-cli): update unknown tag error for aot standalone components update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone component... — committed to dario-piotrowicz/angular by dario-piotrowicz 2 years ago
- fix(core): update unknown tag error for jit standalone components (#45920) update the error message presented during jit compilation when an unrecognized tag/element is found in a standalone componen... — committed to angular/angular by dario-piotrowicz 2 years ago
- fix(compiler-cli): update unknown tag error for aot standalone components (#45919) update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone ... — committed to angular/angular by dario-piotrowicz 2 years ago
- fix(compiler-cli): update unknown tag error for aot standalone components (#45919) update the error message presented during aot compilation when an unrecognized tag/element is found in a standalone ... — committed to angular/angular by dario-piotrowicz 2 years ago
@dario-piotrowicz great, thanks a lot for submitting 2 PRs! 👍
I had a quick look at the JIT PR and I’m sorry that it turned out a bit more involved. I was thinking that we already have the necessary information somewhere close to the code that throws an error. The change in the PR makes sense, I’ll perform additional review asap and let you know if there is any feedback.
Thank you.
Go @dario-piotrowicz , go! I’ve updated the issue description (it was badly formatted, sorry about that).
The basic idea is to determine the type of a component (standalone or not) and adjust the error message based on this type (the standalone flag can be read from the component def).
LMK if you’ve got any questions.
@nthypes Thank you so very much, you’re too kind! 🙏
Thanks @dario-piotrowicz 👍
Of course!!! 😀
Please leave this with me! 🙂