solidjs / vite-plugin-solid

A simple integration to run solid-js with vite
440 stars 51 forks source link

import solid as external to fix testing with npm #152

Closed atk closed 8 months ago

atk commented 8 months ago

When installing the solid-start with-vitest template using npm, you get an error message on tests:

stderr | file://vitest-project/node_modules/solid-js/dist/dev.js:1932:13
You appear to have multiple instances of Solid. This can lead to unexpected behavior.

stderr | src/components/Counter.test.tsx > <Counter /> > increments value
computations created outside a `createRoot` or `render` will never be disposed

This is because npm imports work differently than pnpm imports and vitest does resolve the indirectly included modules using the package manager's resolver. Importing everything solid-js as external fixes this issue.

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: e52d554ecb4d70ca2f1a15337dfbb91978ce2312

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | vite-plugin-solid | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR