-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
utils.ensurePackageInstalled is not compatible with yarn PnP #899
Comments
I additionally had the following problem which I think stems from vitest requiring happy-dom through local-pkg:
After patching vitest with @pietrovismara's fix I had to add the following to "local-pkg@*": # This is required for vitest as it accesses happy-dom through local-pkg on its behalf
dependencies:
"happy-dom": "*" |
we are looking to migrate from jest to vitest but we have the same issue with a yarn2 monorepo |
For anyone trying to use Vitest with pnpm in a monorepo, the following
|
The issue should still be fixed, but as a temporary solution you can add this to
|
Also happens with pnpm and Error looks like:
|
Describe the bug
Trying to run vitest in a package of a yarn monorepo will cause the following error:
I already have vite installed and apparently the issue is caused by this line:
vitest/packages/vitest/src/utils/index.ts
Line 42 in f557565
The
local-pkg
is not compatible with yarn PnP, as confirmed by this issue.As far as I understand it, it should be enough to call
isPackageExists
with a second options parameters like this:I already tested this solution locally with a fork of
local-pkg
and it works.Reproduction
The issue is already confirmed.
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: