New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structural directives not imported in standalone components don't break compilation #51861
Comments
This is fundamentally the same issue as #46351 |
Isn't it kind of different though? Structural directives starting with |
I'd say It more related to #37322, @pkozlowski-opensource do you agree ? |
Yes that's exactly it @JeanMeche, I hadn't seen that issue before :) |
I'll close this one as a dup then ! We can continue the discussion over there ! |
Yes and no :-) Structural directives are just syntax sugar that resolves to directives being matched by attributes. The underlying issue is that our compiler can't detect missus of such directives since we don't know that those are directives. We might be able to improve situation in #37322 but the fundamental problem is directive matching on attribute selectors. |
Thanks for the input all! Hopefully we can fix it 🤞 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
When I don't import a standalone component before using it, the compilation will break.
However, I can have non-imported structural directives in the template and the compilation will not break.
I noticed the following, which you can see in the reproduction repo I linked:
I randomly noticed this during the migration to standalone, but it's quite an annoying bug as it can easily be missed, since the compilation doesn't break.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-structural-directive-repro?file=src%2Fapp.component.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: