question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update error message for an unknown tag in standalone components

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
AndrewKushnircommented, May 8, 2022

@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.

2reactions
pkozlowski-opensourcecommented, May 6, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NG8001: Unknown HTML element or component - Angular
Use the element name in the error to find the file(s) where the element is being used. Check that the name and selector...
Read more >
Windows Update error codes by component - Microsoft Learn
Learn about reference information for Windows Update error codes, including automatic update errors, UI errors, and reporter errors.
Read more >
Cannot update a component while rendering a different ...
My error message was: Warning: Cannot update a component ( ForwardRef(BaseNavigationContainer) ) while rendering a different component ...
Read more >
Angular 13.3.10 Release - GitClear
fix(compiler-cli): update unknown tag error for aot standalone components (#45919) ... fix(core): produce proper error message for unknown props on ...
Read more >
Field - VeeValidate
The Field component renders an HTML input tag if not specified otherwise. ... You may use v-model here or bind the selected attributes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found