3

I've a project setup with yarnv2 and I work within VSCode. TypeScript's tsc can resolve dependencies; however, VSCode cannot.

enter image description here

I've tried yarn dlx @yarnpkg/pnpify --sdk vscode and yarn unplug uuid, but neither has had any effect. I believe the problem is that VSCode expects @types/uuid (and other modules) to be expanded and in a ./node_modules directory at the base of the project; however, I would have also guessed that pnpify or unplug would have assisted. So, I'm just speculating. Is it possible to have VSCode work with Yarn V2 projects or is it not ready, yet?

I also found this, https://stackoverflow.com/questions/60778047/yarn-cannot-find-module, but still no luck.

1 Answer 1

1

I found this https://stackoverflow.com/questions/54954337/is-it-possible-to-use-yarn-pnp-with-typescript-vscode

The critical step that finally got VSCode configured was setting the workspace version to 3.9.7-pnpify. See bottom right of VSCode: enter image description here

However, along the way in trying to solve it, I ran the two commands noted above, and yarn add @yarnpkg/pnpify followed by yarn pnpify --sdk without specifying vscode. Point being, I'm not sure if @yarnpkg/pnpify MUST be in the workspace or not. So if it fails for you, maybe try all of the above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .