skip to Main Content

I updated my Angular 18 applications (with standalone components standalone: true) to Angular 19 using ng update:

❯ Updates non-standalone Directives, Component and Pipes to 'standalone:false' 
  and removes 'standalone:true' from those who are standalone.

So far so good, all standalone: true are removed.

However, Visual Studio Code is now issuing following error for imports: [RouterLink, ...]:

'imports' is only valid on a component that is standalone.

What did I miss?

I followed this guide:

2

Answers



  1. Restarting VS Code, solved the problem as per Thomas. If not try the below suggestion.


    Could you try upgrading the angular language service plugin to the latest version and check if the issue is fixed.

    Login or Signup to reply.
  2. Either restarting VS Code, updating angular language service as mentionened here,

    but if that doesn’t solve the issue and you have a workspace containing multiple different angular projects, try to make a clean workspace containing only v19 projects.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search