Closed jtmueller closed 4 months ago
The issue is in https://github.com/solidjs/templates, which currently seems unmaintained. My last PRs to fix this were ignored, so I closed them.
As a workaround, you can run pnpm update, especially for vitest and vite-plugin-solid, which fixes the issue.
@atk Thanks for that. I thought I had found an isolated repro case for my actual problem, where my project gets these errors even with the latest libraries installed. Turns out it also gets these errors when npm or bun is used, and whatever was causing them in the templates must be unrelated to what was causing them in my project.
Maybe I'll try adding other solid-related dependencies that my real project has, to the template project, see if I can find a cause.
Describe the bug
Using Vitest to test a SolidJS project results in one instance of the following error for each test suite: "You appear to have multiple instances of Solid. This can lead to unexpected behavior."
And one instance of this error per test: "computations created outside a
createRoot
orrender
will never be disposed"But this only happens when pnpm is used as the package manager. I recognize that you'll probably tell me this isn't a SolidJS bug, and I can't blame you for that. However, I have never come across any suggestions that the package manager might be at fault in all of the time I've spent searching for solutions to this issue. I have tried so many different vite.config settings and none of them have done any good, so I'm hoping that someone else in this situation might come across this issue even if it's closed.
Also, I'm not sure what's actually going on here, and I would welcome any suggestions as to whether this is a Vitest issue or a Pnpm issue, and how to report it in a way that won't be immediately bounced back as not their problem.
Or maybe there's a workaround in the vitest config?
Your Example Website or App
https://github.com/solidjs/templates/tree/main/ts-vitest
Steps to Reproduce the Bug or Issue
1.
npx degit solidjs/templates/ts-vitest solid-vitest
cd solid-vitest
pnpm i
pnpm run test
You will see messages like:
Now you can run
rm -rf node_modules
and try installing and running the tests with eithernpm
orbun
and the errors will not occur.Expected behavior
As a user, I expected vitest and solidjs to work regardless of which package manager I use.
Screenshots or Videos
No response
Platform
Additional context
No response