Skip to content

Adding vitest creates dozens of errors (with repro) #2005

@205g0

Description

@205g0

Describe the bug

Adding vitest to a project creates dozens of error like following:

[2] /home/projects/sveltejs-kit-template-default-tmdb5e/.svelte-kit/generated/root.svelte:51:5
[2] Error: Variable 'title' implicitly has an 'any' type. (js)
[2]             {#if navigated}
[2]                     {title}
[2]             {/if}

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-tmdb5e?file=svelte.config.js

Wait a bit until the server has started and you should see 21 errors.

Now, change in package.json this line:

		"dev": "concurrently 'vite dev' 'npm run test'  'npm run check:watch'",

to:

		"dev": "concurrently 'vite dev'  'npm run check:watch'",

and remove .svelte-kit and rerun the server with:

rm .svelte-kit/ -rf && npm run dev

and all errors vanish.

I uses the exact setup as in the create SvelteKit demo project.

Logs

To keep this post short, please check repro.

System Info

Check  repro.

Severity

blocking all usage of SvelteKit

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions