-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/@vite/client won't load after adding peerDependencies under Yarn 2/PnP #1423
Comments
I tried to look into this but honestly, Yarn 2 is such a blackbox and debugging for it is just a nightmare. Please switch to another package manager if possible. |
Facing same issue with NPM |
@shawnwildermuth then it's a totally different problem. Please open a separate issue with its own reproduction. |
For me, it was a mismatch between vite installed globally (old version). So ignore it. |
FYI it works if you |
I guess what you mean is that Yarn PnP is a blackbox, Yarn 2 !== Yarn PnP, just like Yarn 1 it supports both PnP and
It's because of the two dollar signs ( |
The fact that Vite is bundled doesn't make it a black box. The code isn't minified or mangled and the logic remains the same. Unlike Yarn 2 archives, you can't even open or modify it without unplugging.
I just tested a mocked package with $$ in its path name and it works properly. |
Describe the bug
When a manual peer dependency is listed for Vite (e.g. a CSS preprocessor) and Vite is in a workspace of a monorepo, the Vite client cannot be resolved. If the peer dependency is not added, it cannot be resolved due to PnP strict rules.
If you were to create a node script to run
fs.promises.resolve("<CLIENT_PACKAGE>")
in the same workspace, this runs fine.Reproduction
A minimal reproduction can be found here.
System Info
vite
version:2.0.0-beta.12
Arch Linux x86_64 (kernel 5.9.13-arch1-1)
v14.10.1
yarn 2.4.0
Logs
Workaround
Manually hoisting the "less" package to the root package.json instead of adding the peer dependency to .yarnrc.yml works, but I don't think that should be necessary, and goes against the point of monorepos.
The text was updated successfully, but these errors were encountered: