-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
vitest install error: No overload matches this call #341
Comments
The core problem here is that we are switching the type for the vite config from // without vitest
import { defineConfig } from 'vite';
// with vitest
import { defineConfig } from "vitest/config"; Still trying to find any relevant issue. Currently only found this discussion in vite repo: vitejs/vite#8509 Look's like the vitest config has not been updated to match vite 6 |
Did not find anything meaningful, therefore created this issue: vitest-dev/vitest#7014 |
The mismatch in types is because Types can be fixed by reverting back to |
see dominikg/vitest-example-svelte5#1 for a setup that works with vite@6, vitest@3 beta and latest sveltekit/svelte |
As far as I could tell, the issue is somehow related My reproduction:
Edit: Looked into the directory Edit again: My solution is to include the following in {
/* ... */
"overrides": {
"vitest": {
"vite": "^6.0.0"
}
},
} |
This is still happening with the default sv template. At least on npm. When running Edit: same issue on pnpm.... both on a brand new
Edit2: the override proposed by @qbtf does not work, at least on pnpm edit3: package.json for future reference {
"name": "svelte5",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^6.0.0",
"vitest": "^2.0.4"
},
"dependencies": {
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15"
},
"overrides": {
"vitest": {
"vite": "^6.0.0"
}
},
"packageManager": "pnpm@8.15.6+sha512.77b89e9be77a2b06ad8f403a19cae5e22976f61023f98ad323d5c30194958ebc02ee0a6ae5d13ee454f6134e4e8caf29a05f0b1a0e1d2b17bca6b6a1f1159f86"
} |
for pnpm it is either |
Ah, I see. My bad. I will say that updating to vitest 3.0 beta also works |
@Oudwins My solution works only with npm. I think npm is still the de facto standard and a npm package cannot work out-of-the-box is strange. |
We have reverted the changes to use |
version
sv@0.6.6
steps
rm -rf ./* ./.*
to remove directory contentsnpx sv create .
y
to install sv@0.6.6observed
sveltekit()
errors with 'No overload matches this call.'The text was updated successfully, but these errors were encountered: