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?
Asked
Active
Viewed 4,404 times
2 Answers
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
-
1Great workaround! – Ross Sep 29 '22 at 18:23
-
1Just for people who aren't familiar with using CMP + P, don't ignore the ">" symbol in his answer like I did please. – Boz May 26 '23 at 03:35
-
@Boz my bad, you can also use `CMD + SHIFT + P` to enter the Command Palette directly – ChazUK Jul 18 '23 at 09:36
2
This is a known (and buggy?) behavior in VSC. I use TS with Angular 12, and the following works for me:
- Open the command palette using
Ctl + Shift + p
(orCmd + Shift + p
on Mac) - Type "
Restart Angular Language Server
" - 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