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

Unable to run Vitest with Yarn PnP #109

Open
Haemoglobin opened this issue Jul 11, 2023 · 1 comment
Open

Unable to run Vitest with Yarn PnP #109

Haemoglobin opened this issue Jul 11, 2023 · 1 comment

Comments

@Haemoglobin
Copy link

Haemoglobin commented Jul 11, 2023

Describe the bug

Using the ts-vitest template located here,
running "yarn test" works on yarn 1:
image

But not with later versions of yarn (3+):
image

I was able to run the tests successfully after converting the solution to React and commenting out the following line in vite.config.ts:
deps: { registerNodeLoader: true }

However the issue seems to persist in the solidjs version if the same change is made.

The working react repository is here: https://github.com/Haemoglobin/solidjs-yarn/tree/react

Your Example Website or App

https://github.com/Haemoglobin/solidjs-yarn

Steps to Reproduce the Bug or Issue

  1. Clone https://github.com/Haemoglobin/solidjs-yarn
  2. Run: yarn install
  3. Run: yarn test

Expected behavior

Tests run correctly without error, similarly to the converted react example here https://github.com/Haemoglobin/solidjs-yarn/tree/react

Screenshots or Videos

No response

Platform

  • OS: Windows

Additional context

No response

@ryansolid ryansolid transferred this issue from solidjs/solid Jul 11, 2023
@Haemoglobin
Copy link
Author

Additional info, it seems to only be an issue with pnp mode enabled.
Adding the following to .yarnrc.yml gets it working again:
nodeLinker: pnpm

I presume the node-modules mode would also work.

However it would still be good to know what is required to get it working with pnp mode as this is the default mode for Yarn Berry.

Thanks

@Haemoglobin Haemoglobin changed the title Unable to run Vitest with Yarn 3+ Unable to run Vitest with Yarn PnP Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant