9

I'm working on a project with Nrwl nx in VSCode and whenever I change a route to a library or the prefix for a library my code shows a bunch of false errors. Everything still renders as expected but I need to reboot VSCode to make all the red lines and text go away. Why is this happening? Is there a way to do something in the terminal to reset/update whatever it is that corrects itself at reoot?

Russ Cam
  • 124,184
  • 33
  • 204
  • 266
Optiq
  • 2,835
  • 4
  • 33
  • 68

2 Answers2

15

I think a quick fix to this is to restart the TypeScript Server within VSCode using the Command Palette.

CMD + SHIFT + P then type Restart TS Server

you can also open the "Go to File" dialog using CMD + P and then type > to enter the Command Palette.

ChazUK
  • 744
  • 4
  • 26
2

This is a known (and buggy?) behavior in VSC. I use TS with Angular 12, and the following works for me:

  1. Open the command palette using Ctl + Shift + p (or Cmd + Shift + p on Mac)
  2. Type "Restart Angular Language Server"
  3. On rare occasions that the above doesn't work, in step 2, you can write "Developer: Reload Window"

I hope Microsoft will fix this issue soon - until then, this is the best solution I know.

Shaya
  • 2,792
  • 3
  • 26
  • 35