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

Cannot find package 'vitest' #662

Open
mbwestphal opened this issue Feb 6, 2025 · 0 comments
Open

Cannot find package 'vitest' #662

mbwestphal opened this issue Feb 6, 2025 · 0 comments

Comments

@mbwestphal
Copy link

  • @testing-library/jest-dom version: 6.6.3
  • node version: v22.13.1
  • jest (or vitest) version: 3.0.5
  • npm (or yarn) version: [email protected]

Relevant code or config:

; .npmrc
hoist=false

What you did:

Tried running tests.

What happened:

Error: Cannot find package 'vitest' imported from /path/to/project/ui/node_modules/.pnpm/@[email protected]/node_modules/@testing-library/jest-dom/dist/vitest.mjs

Suggested solution:

vitest is declared in the devDependencies of @testing-library/jest-dom but it must be declared in the dependencies or peerDependencies because @testing-library/jest-dom/dist/vitest.mjs is importing vitests expect at test run time.

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