Webstorm cannot find imports after rebuild

I have imports from a shared library in my monorepo:

import Pizza from '@app/shared/build/pizza'


These work fine until I delete the `packages/shared/build` folder and rebuild it during the build process. (For various reasons I need to delete the folder and re-build it.) When the folder gets deleted, Webstorm rightly complains that it can't find the imports, but then it never refreshes subsequently once they're back (15 seconds or so later). I need to restart Webstorm to get the imports to work again.

How can I get Webstorm to refresh these imports after they've (briefly) disappeared, without restarting?

 

3 comments
Comment actions Permalink

What error do you see namely? Also, does re-loading the files from disk (File > reload all From Disk) help?

0
Comment actions Permalink

Elena Pogorelova The imports show up with the red squiggly underline; hovering on them shows the error: `TS2307: Cannot find module '@app/shared/build/pizza'`. A Typescript error, obviously, so possibly this issue is with the Typescript plugin? Unfortunately File > Reload All From Disk has no effect.

0
Comment actions Permalink

does restarting TS service help? To re-start it, click on Typescript <version> widget in the status bar, and then choose Restart TypeScript Service

1

Please sign in to leave a comment.