solidjs / templates

Vite + solid templates
446 stars 117 forks source link

Unable to run Vitest with Yarn PnP #109

Open Haemoglobin opened 1 year ago

Haemoglobin commented 1 year ago

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

Additional context

No response

Haemoglobin commented 1 year ago

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