Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

Compiler does not detect changes when updating types or interfaces in types.ts

$
0
0

Im working on several large projects usingvisual studio code, react, typescript, node, webpack etc.. that are unrelated but all have the same issue

For some components that use common types, I extract them into a type.ts file or interface.ts so I can import them to multiple components.


Problem:

I have an interesting issue where anytime I update these types or interfaces (such as changing a string type to number, adding, deleting or any type of update) my compiler does not pick up the changes and throws errors when I try to use the updated type or interface

Only solution I currently have:

  1. Save file & Close vsc (fully quit - reload does not work)
  2. Run npm start again (after doing this, the new changes are picked up

Does anyone know a better solution to this?

Such as a way to tell node to watch and apply changes in these files or some way to do the same with typescript compiler or?


Viewing all articles
Browse latest Browse all 11661

Trending Articles