Skip to content

npm run check fails on newly bootstrapped SvelteKit project with vitest #14542

@mjswensen

Description

@mjswensen

Describe the bug

There is a type mismatch between the Vite plugins returned by sveltekit() (from @sveltejs/kit/vite) and what's expected by vitest/config.

Reproduction

  1. (Optional: get into a Docker container with Node.js installed: docker run --rm -it mcr.microsoft.com/devcontainers/javascript-node:20 bash)
  2. Run npx sv create my-app
    • Choose "SvelteKit minimal" for the template.
    • Choose "Yes, using Typescript syntax" for TS support.
    • Select "vitest" for the project add-on.
    • Choose "npm" for the package manager.
  3. Run npm run check

Logs

The error is `Type 'Plugin<any>' is not assignable to type 'false | Plugin<any> | PluginOption[] | null | undefined'.`.

System Info

System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (4) arm64 unknown
    Memory: 12.91 GB / 15.58 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.14.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.7.0 - /usr/local/bin/npm
    pnpm: 9.1.4 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    svelte: ^5.0.0 => 5.5.3

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions