solidjs / solidjs/solid-vite-plugin
Vitest fails with TypeError: Unknown file extension ".jsx"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 520
- Forks
- 70
- Avg merge
- 23h 35m
- Merged PRs (30d)
- 39
Description
I am trying to test a component using Vitest, but following the documentation fails with this error
https://docs.solidjs.com/guides/testing#adding-testing-packages
TypeError: Unknown file extension ".jsx" for /media/aminya/Linux/GitHub/test/test/node_modules/.pnpm/@corvu+utils@0.2.0_solid-js@1.8.17/node_modules/@corvu/utils/dist/reactivity/index.jsx
My test file is a tsx file. It seems Vitest has trouble loading the .jsx file. My config is the same as the doc.
"@solidjs/testing-library": "^0.8.8",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/user-event": "^14.5.2",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.6.0",
"solid-devtools": "^0.30.1",
"typescript": "^5.4.5",
"vite": "^5.2.12",
"vite-plugin-solid": "^2.10.2",
"vitest": "^1.6.0"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Solid testing guide linked in the report and the documented Vitest configuration, then reproduce the failure involving the .jsx file under node_modules/@corvu/utils. Done means the documented setup can run the reported TSX component test without the unknown file extension error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100