VSCode needs to be restarted after modifying tsconfig and tslint files in nrwl nx projects to eliminate errors

Viewed 1706

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?

2 Answers

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

CMD + P then type > Restart TS Server

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.

Related