question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yarn 3 incompatibility

See original GitHub issue

Thank you for the awesome extension! I loved using it with takeover mode, but it seems completely broken as of moving off to Yarn 3 without the node_modules folder.

First of all, it doesn’t seem to work with Yarn 3 relative path workspaces. If I have my dependency like

"gun": "workspace:packages/gun",

I can’t refer to it like

import Gun from 'gun';

And get to refer to it like

import Gun from '@/../../gun';

instead.

Even though without Volar, Yarn 3 workspaces are perfectly handled.

If I disable Take Over Mode, Vue TS checks fail completely: image

Then, VSCode shows two tooltips rather than one: image

If Volar has any issues that VSCode has not, these messages differ: image

The upper one finds the module, the lower one (Volar) does not.

Last, but not least – Volar doesn’t import packages from .yarn: image

Is Yarn 3 support not intended? I really wish it was working. Hope it’s not much of a headache to fix this. Thank you in advance!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
merceyzcommented, Oct 18, 2022

however, in a monorepo, the same resolution errors occur. here’s a reproduction monorepo: https://github.com/adalinesimonian/volar-workspaces-pnp-test

@adalinesimonian The error I get in that repo is

Cannot find module 'vue'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?ts(2792)

If I then set the moduleResolution to node it works.


Sorry i’m not familiar with this part, I assume that we just need setting the yarn 3 version tsdk to typescript.tsdk? I will add documentation for it. (If I’m right)

@johnsoncodehk typescript.tsdk is set by Yarn so Volar just needs to be told to use the workspace version. https://yarnpkg.com/getting-started/editor-sdks/#vscode If the workspace is trusted and typescript.tsdk is set Volar could probably pick the workspace version automatically.


which presumably doesn’t recognise ts sdk provided by yarn

@Lexpeartha it recognizes it.

2reactions
adalinesimoniancommented, Sep 28, 2022

here’s a reproduction repository: https://github.com/adalinesimonian/volar-pnp-test

i’ve tested this in a workspace and without and it happens either which way.

Screenshot of module resolution errors in VS Code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 ... This should make it easier for third-party tools to...
Read more >
Yarn 3.0 Performances, ESBuild, Better Patches
When using Yarn 3 w/ PnP, the exports field will be properly resolved regardless of your Node version. If you're not familiar with...
Read more >
Yarn incompatibility! - School of Weaving Forums
Everything in the warp is Harrisville Shetland EXCEPT that layer was alternating Harrisville and Alice Staremore Hebridean 3 ply. The yarns seemed very ......
Read more >
Yarn is using an incompatible version of node, inspite of being ...
So the commenter Ravi was correct. i needed to uninstall volta. dont have both nvm and volta installed; especially if you intend to...
Read more >
It's 2021, and You Should Switch to Yarn 2 - Atomic Spin
Here are three reasons you might have waited to make the switch — and why those reasons are out of date in 2021....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found