Skip to content
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

ng19 Standalone imports are not recognized unless "standalone: true" is specified. #76

Open
emonney opened this issue Nov 29, 2024 · 1 comment

Comments

@emonney
Copy link

emonney commented Nov 29, 2024

In angular 19 standalone imports are the default so setting "standalone: true" in component declaration is not needed/recommended.
However VisualStudio does not recognize the imports and shows this error: 'imports' is only valid on a component that is standalone.(-992010)
Also everything that depends on those imports also shows errors. The template and code editors are riddled with false positive errors.

Update the language service to recognize that angular 19+ components are standalone by default and don't need the extra "standalone: true" decoration.

@Khyalis
Copy link

Khyalis commented Dec 23, 2024

Can you confirm, e.g. by looking at the "Angular Language Service Extension" output in the Output window, that the version of @angular/language-server being used is 19 or higher?

Otherwise it could seem related to #78 and version 17 of the language server being bundled with the extension, and a local version only being used if installed directly into the solution directory.

I tried updating to version 19.0.3 of @angular/language-server, but the issue of not taking into consideration the new default of implying standalone: true when not specifying standalone persists. and now a component with standalone unspecified is recognized as being standalone.

(A similar issue has been reported for @angular/language-server (angular/vscode-ng-language-service#2130), although I believe it might be unrelated.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants