WebStorm won't automatically import NX monorepo modules
I'm building a monorepo app in TypeScript using NX. WebStorm won't automatically import from my other NX modules (which are prefixed with @myproj). I can press Option+Return and select “Add import from @myproj/common” from the contextual menu, however it is very frustrating to do this for every import. Please let me know if there is a way to configure WebStorm to make this automatic. Thanks!
请先登录再写评论。
It generally works right out of the box. Could you please assist us by narrowing down the issue to a minimal repository project and sharing it with us?
Sure… I created an NX monorepo with two libraries, mylib and mylib2. The exported mylib2() function in mylib2 won't auto-import in mylib (and vice-versa). This is similar to my current setup where I have a node backend library and a common library.
Here's how I created the project and libraries:
In libs/mylib/src/lib/mylib.ts:
Thank you for your help in providing all the details. We managed to reproduce the problem and have created a new ticket:: WEB-73859. Please vote for it to get notified of any progress,
Thank you!