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

vitest install error: No overload matches this call #341

Open
mxfactorial opened this issue Dec 3, 2024 · 4 comments
Open

vitest install error: No overload matches this call #341

mxfactorial opened this issue Dec 3, 2024 · 4 comments
Labels
bug Something isn't working upstream

Comments

@mxfactorial
Copy link

version

[email protected]

steps

  1. open a typescript gitpod
  2. select continue button to create a new workspace
  3. wait for the editor to appear
  4. cntrl c the init task to cancel or open a new terminal
  5. rm -rf ./* ./.* to remove directory contents
  6. npx sv create .
  7. y to install [email protected]
  8. choose:
    1. SvelteKit minimal
    2. Typescript syntax
    3. vitest
    4. npm
  9. open vite.config.ts

observed

sveltekit() errors with 'No overload matches this call.'

Screenshot 2024-12-02 at 8 38 16 PM
@manuel3108
Copy link
Member

The core problem here is that we are switching the type for the vite config from vite to vitest and it looks like vitest currently does not support plugins of type Promise<whatever>

// 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

@manuel3108
Copy link
Member

Did not find anything meaningful, therefore created this issue: vitest-dev/vitest#7014

@manuel3108 manuel3108 added bug Something isn't working upstream labels Dec 3, 2024
@AdrianGonz97
Copy link
Member

The mismatch in types is because vitest reverted support for Vite 6 in 2.1.7.

Types can be fixed by reverting back to 2.1.6 or using pnpm.overrides to force vitest to use Vite 6. Though, I would just ignore the type error for now until they fix things on their end in a new release.

@dominikg
Copy link
Member

dominikg commented Dec 9, 2024

see dominikg/vitest-example-svelte5#1 for a setup that works with vite@6, vitest@3 beta and latest sveltekit/svelte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

4 participants