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

import solid as external to fix testing with npm #152

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

atk
Copy link
Contributor

@atk atk commented Mar 11, 2024

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.

Copy link

changeset-bot bot commented Mar 11, 2024

🦋 Changeset detected

Latest commit: e52d554

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

@ryansolid ryansolid merged commit 758f2af into solidjs:main Mar 15, 2024
@atk atk deleted the external-solid-for-testing-with-npm branch March 15, 2024 19:51
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

Successfully merging this pull request may close these issues.

2 participants