You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using storybookNextJsPlugin in a vitest.workspace.ts file and it errors about a type miss-match.
Steps to reproduce the behavior
vite 6.2.3
vitest 2.1.9
storybook 8.6.11
import{defineWorkspace}from"vitest/config";import{storybookTest}from"@storybook/experimental-addon-test/vitest-plugin";import{storybookNextJsPlugin}from"@storybook/experimental-nextjs-vite/vite-plugin";import{join}from"path";import{resolveRoot}from"@company/tools-esm/helpers/paths";const{MR_ID}=process.env;constIS_CI=process.env.IS_CI||"false";exportdefaultdefineWorkspace([{extends: "./vite.config.mts",plugins: [storybookTest({// This should match your package.json script to run Storybook// The --ci flag will skip prompts and not open a browserstorybookScript: "yarn storybook --ci",storybookUrl: (()=>{if(IS_CI!=="true")return"http://local.company-stage.com:9002";returnMR_ID
? `https://storybook-web-next-${MR_ID}.company-stage.com/`
: `https://storybook-web-next.company-stage.com/`;})(),}),storybookNextJsPlugin({dir: join(resolveRoot(),"projects","web-next"),}),],test: {name: "storybook",// Enable browser modebrowser: {enabled: true,name: "chromium",// Make sure to install Playwrightprovider: "playwright",headless: true,},// Speed up tests and better match how they run in Storybook itself// https://vitest.dev/config/#isolate// Consider removing this if you have flaky testsisolate: false,setupFiles: ["./.storybook/vitest.setup.ts"],},},{extends: "./vite.config.mts",test: {include: ["./**/*.test.ts"],name: "unit",environment: "node",},},]);
Expected behavior
No error
Screenshots and/or logs
Type 'Plugin<any>[]' is not assignable to type 'PluginOption'.
Type 'Plugin<any>[]' is not assignable to type 'PluginOption[]'.
Type 'Plugin<any>' is not assignable to type 'PluginOption'.
Type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").Plugin<any>' is not assignable to type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").Plugin<any>'.
Types of property 'apply' are incompatible.
Type '"build" | "serve" | ((this: void, config: import("/Users/b.s/project/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"build" | "serve" | ((this: void, config: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | und...'.
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/b.s/project/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
Types of parameters 'config' and 'config' are incompatible.
Type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").UserConfig'.
Types of property 'plugins' are incompatible.
Type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
Type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption'.
Type 'Plugin<any>' is not assignable to type 'PluginOption'.
Type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").Plugin<any>' is not assignable to type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").Plugin<any>'.
Types of property 'apply' are incompatible.
Type '"build" | "serve" | ((this: void, config: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | und...' is not assignable to type '"build" | "serve" | ((this: void, config: import("/Users/b.s/project/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/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/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/b.s/project/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/b.s/project/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
Types of parameters 'config' and 'config' are incompatible.
Type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").UserConfig'.
Types of property 'plugins' are incompatible.
Type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
Type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'import("/Users/b.s/project/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/b.s/project/node_modules/vitest/node_modules/vite/dist/node/index").PluginOption'.
Type 'Promise<Plugin<any> | FalsyPlugin | PluginOption[]>' is not assignable to type 'PluginOption'.
Type 'Promise<Plugin<any> | FalsyPlugin | PluginOption[]>' is not assignable to type 'Promise<false | Plugin<any> | PluginOption[] | null | undefined>'.
Type 'Plugin<any> | FalsyPlugin | PluginOption[]' is not assignable to type 'false | Plugin<any> | PluginOption[] | null | undefined'.
Type 'Plugin<any>' is not assignable to type 'false | Plugin<any> | PluginOption[] | null | undefined'.
Environment
OS: [e.g. iOS] macOS 15.3
Node.js version: [e.g. v12.17.0] 22.14.0
NPM version: [e.g. 6.14.4] yarn 1.22
Browser (if applicable): [e.g. chrome, safari]
Browser version (if applicable): [e.g. 22]
Device (if applicable): [e.g. iPhone6]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm using
storybookNextJsPlugin
in avitest.workspace.ts
file and it errors about a type miss-match.Steps to reproduce the behavior
vite 6.2.3
vitest 2.1.9
storybook 8.6.11
Expected behavior
No error
Screenshots and/or logs
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: