Skip to content

bun run check fails with "Type 'Promise<Plugin_2[]>' is not assignable to type 'PluginOption'." #10802

Closed as not planned
@codinkai

Description

@codinkai

Describe the bug

Hi,
I have setup a new sveltekit project with typescript and prettier enabled.

When I run bun run check, I get the error below.

What can I do to get rid of this error?

Reproduction

npm create svelte@latest my-app
cd my-app
npm install
npm run check

Logs

====================================
Loading svelte-check in workspace: /Users/kai/Desktop/my-app
Getting Svelte diagnostics...

/Users/kai/Desktop/my-app/vite.config.ts:5:12
Error: No overload matches this call.
  The last overload gave the following error.
    Type 'Promise<Plugin_2[]>' is not assignable to type 'PluginOption'.
      Type 'Promise<Plugin_2[]>' is not assignable to type 'Promise<false | Plugin_2<any> | PluginOption[] | null | undefined>'.
        Type 'Plugin_2[]' is not assignable to type 'false | Plugin_2<any> | PluginOption[] | null | undefined'.
          Type 'Plugin_2[]' is not assignable to type 'PluginOption[]'.
            Type 'Plugin_2' is not assignable to type 'PluginOption'.
              Type 'Plugin_2' is not assignable to type 'Plugin_2<any>'.
                Types of property 'apply' are incompatible.
                  Type '"build" | "serve" | ((this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"build" | "serve" | ((this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
                    Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"build" | "serve" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
                      Type '(this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
                        Types of parameters 'config' and 'config' are incompatible.
                          Type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig'.
                            Types of property 'plugins' are incompatible.
                              Type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
                                Type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption[]'.
                                  Type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption'.
                                    Type 'Plugin_2<any>' is not assignable to type 'PluginOption'.
                                      Type 'Plugin_2<any>' is not assignable to type 'Plugin_2'.
                                        Types of property 'apply' are incompatible.
                                          Type '"build" | "serve" | ((this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"build" | "serve" | ((this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
                                            Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"build" | "serve" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
                                              Type '(this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
                                                Types of parameters 'config' and 'config' are incompatible.
                                                  Type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig'.
                                                    Types of property 'plugins' are incompatible.
                                                      Type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
                                                        Type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[]'.
                                                          Type 'import("/Users/kai/Desktop/my-app/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/kai/Desktop/my-app/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption'.
                                                            Type 'Promise<false | Plugin_2 | PluginOption[] | null | undefined>' is not assignable to type 'PluginOption'.
                                                              Type 'Promise<false | Plugin_2 | PluginOption[] | null | undefined>' is not assignable to type 'Promise<false | Plugin_2<any> | PluginOption[] | null | undefined>'.
                                                                Type 'false | Plugin_2 | PluginOption[] | null | undefined' is not assignable to type 'false | Plugin_2<any> | PluginOption[] | null | undefined'.
                                                                  Type 'Plugin_2' is not assignable to type 'false | Plugin_2<any> | PluginOption[] | null | undefined'. 
export default defineConfig({
	plugins: [sveltekit()],
	test: {


====================================
svelte-check found 1 error and 0 warnings in 1 file
error: script "check" exited with code 1 (SIGHUP)

System Info

System:
    OS: macOS 11.7.10
    CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
    Memory: 72.07 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.17.1 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
    pnpm: 8.6.3 - /usr/local/bin/pnpm
    Watchman: 2023.09.04.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 117.0.5938.92
    Safari: 16.6
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0 
    @sveltejs/kit: ^1.20.4 => 1.25.1 
    svelte: ^4.0.5 => 4.2.1 
    vite: ^4.4.2 => 4.4.9

Severity

annoyance

Additional Information

No response

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