You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vitest fails with TypeError: Unknown file extension ".jsx" #157
No, I could not fix the issue, but I added a production in #158 as well. I talked to @ryansolid about this. He mentioned that @atk created the testing part of the plugin.
Activity
NexRX commentedon Jul 15, 2024
Im not alone, yes!
I have a stackblitz here that reproduces it and it's fairly minimal, only adding one file ontop of the solidstart vitest template.
https://stackblitz.com/edit/solidjs-templates-6zmfus?file=package.json&view=editor
Did you ever manage to fix it?
aminya commentedon Jul 15, 2024
No, I could not fix the issue, but I added a production in #158 as well. I talked to @ryansolid about this. He mentioned that @atk created the testing part of the plugin.
atk commentedon Jul 16, 2024
It is really hard to keep up with the constant changes, so I'm sorry, but I have no fast solution.
aminya commentedon Jul 16, 2024
Does #158 help you debug the issue?
NexRX commentedon Jul 17, 2024
I'm working around this with the experimental vitest feature 'browser mode' so no fast solutions needed personally :)
jaroel commentedon Sep 16, 2024
I'm on MacOS and use PNPM.
preserveSymlinks: trueseems to fix the problem for me, YMMV.kiocos commentedon Dec 3, 2025
@aminya were you able to fix this?
paularmstrong commentedon Dec 30, 2025
This seems to have regressed when updating to Vitest 4.
atk commentedon Dec 30, 2025
You need to add vite-plugin-solid to that config.
paularmstrong commentedon Dec 31, 2025
@atk I have it in my configs, but it does not work with vitest 4. Downgrading to 3 works fine.
atk commentedon Dec 31, 2025
This is strange, it works for me with
paularmstrong commentedon Jan 5, 2026
Are there some special or specific tsconfigs, maybe? Here's what I'm using
{ "compilerOptions": { "allowImportingTsExtensions": true, "allowSyntheticDefaultImports": true, "allowUnreachableCode": false, "allowUnusedLabels": false, "checkJs": true, "composite": true, "declaration": true, "declarationMap": false, "downlevelIteration": true, "erasableSyntaxOnly": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "jsx": "preserve", "jsxImportSource": "solid-js", "lib": ["esnext", "dom", "dom.iterable"], "module": "esnext", "moduleResolution": "bundler", "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noUncheckedIndexedAccess": true, "noUnusedLocals": true, "noUnusedParameters": false, "removeComments": true, "resolveJsonModule": true, "rewriteRelativeImportExtensions": true, "skipLibCheck": true, "strict": true, "target": "esnext", "types": ["node", "vite/client", "vitest/globals", "@testing-library/jest-dom/vitest"], "verbatimModuleSyntax": true } }atk commentedon Jan 6, 2026
I have now used your tsconfig, but vitest still runs without any issue. Here's my vite.config.ts:
And here is package.json:
{ "name": "vite-template-solid", "version": "0.0.0", "description": "", "type": "module", "scripts": { "start": "vite", "dev": "vite", "build": "vite build", "serve": "vite preview", "test": "vitest" }, "license": "MIT", "devDependencies": { "happy-dom": "^20.0.11", "typescript": "^5.7.2", "vite": "^7.1.4", "vite-plugin-solid": "^2.11.8", "vitest": "^4.0.16" }, "dependencies": { "solid-js": "^1.9.10" } }fix cannot use name: solid-js (see vitest-dev/vitest#6418 and solidjs…
paularmstrong commentedon Jan 28, 2026
@atk here's a repro: https://stackblitz.com/edit/vitejs-vite-uwafdm6n?file=vitest.config.ts
Perhaps it's using a monorepo that's the issue? Is the plugin not resolving paths to node_modules correctly?
atk commentedon Jan 28, 2026
Stackblitz is known to have issues. Can you try to run it locally?
paularmstrong commentedon Jan 28, 2026
It has the same result in stackblitz and locally.
green3g commentedon Jan 29, 2026
I had a similar issue with solidjs router - this ended up being the fix for me:
idofilus commentedon Mar 1, 2026
Thank you, this part helped me too, here is mine: