Skip to content
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

Yarn PnP support #2

Open
NMinhNguyen opened this issue Jan 4, 2022 · 5 comments · May be fixed by #15
Open

Yarn PnP support #2

NMinhNguyen opened this issue Jan 4, 2022 · 5 comments · May be fixed by #15

Comments

@NMinhNguyen
Copy link

I'm trying to use Vitest and I'm running into an issue with Yarn PnP:

.pnp.cjs:101340 Uncaught Error: local-pkg tried to access vite, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: vite (via "vite/package.json")
Required by: local-pkg@npm:0.4.0 (via /Users/minh/dev/project/.yarn/cache/local-pkg-npm-0.4.0-c31827f33b-46964cea4b.zip/node_modules/local-pkg/)

I believe that this package needs to support basedir (similar to resolve), and set the paths option of require.resolve:

https://github.com/antfu/local-pkg/blob/fc9d06c5a43485d83f41ec35dfc842e1f6d45aa5/index.mjs#L51-L65

@TeemuKoivisto
Copy link

Yes this is still an issue. Is there an easy fix for this?

@sirganya
Copy link

bump

@JoshuaKGoldberg
Copy link

This also happens with pnpm: vitest-dev/vitest#3112.

@francoisauclair911
Copy link

bump

@wojtekmaj
Copy link

FYI - Vitest no longer uses local-pkg as of version 2.0.0, and therefore, PnP issues are also gone.

@qmhc qmhc linked a pull request Sep 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants