Repository navigation
Closed
Labels
pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bug
Description
Describe the bug
import react from '@vitejs/plugin-react'
// vitest.config.ts
import { defineConfig } from 'vitest/config'
import { WxtVitest } from 'wxt/testing'
export default defineConfig({
plugins: [WxtVitest(), react()],
test: {
environment: 'node',
globals: true,
setupFiles: 'vitest.setup.ts',
watch: false,
coverage: {
provider: 'istanbul',
reporter: ['text', 'html', 'lcov'],
},
},
})After upgrading from 0.20.6 to 0.20.7, I met the error:
> [email protected] compile /Users/leonz/Github/read-frog
> tsc --noEmit
vitest.config.ts:8:13 - error TS2769: No overload matches this call.
The last overload gave the following error.
Type 'Promise<PluginOption[]>' is not assignable to type 'PluginOption'.
Type 'Promise<PluginOption[]>' is not assignable to type 'Promise<Plugin<any> | FalsyPlugin | PluginOption[]>'.
Type 'PluginOption[]' is not assignable to type 'Plugin<any> | FalsyPlugin | PluginOption[]'.
Type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").PluginOption'.
Type 'Plugin<any>' is not assignable to type 'PluginOption'.
Type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").Plugin<any>' is not assignable to type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").Plugin<any>'.
Types of property 'hotUpdate' are incompatible.
Type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/rollup").ObjectHook<(this: HotUpdatePluginContext, options: import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/ind...' is not assignable to type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/rollup").ObjectHook<(this: HotUpdatePluginContext, options: import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/ind...'.
Type '(this: HotUpdatePluginContext, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<void | EnvironmentModuleNode[]>' is not assignable to type 'ObjectHook<(this: HotUpdatePluginContext, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<void | EnvironmentModuleNode[]>> | undefined'.
Type '(this: HotUpdatePluginContext, options: import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").HotUpdateOptions) => void | ... 1 more ... | Promise<...>' is not assignable to type '(this: HotUpdatePluginContext, options: import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").HotUpdateOptions) => void | ... 1 more ... | Promise<...>'.
The 'this' types of each signature are incompatible.
Type 'HotUpdatePluginContext' is not assignable to type 'HotUpdatePluginContext'. Two different types with this name exist, but they are unrelated.
The types of 'environment.pluginContainer.environment' are incompatible between these types.
Type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").Environment' is not assignable to type 'import("/Users/leonz/Github/read-frog/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/index").Environment'.
Type 'DevEnvironment' is not assignable to type 'Environment'.
8 plugins: [WxtVitest(), react()],
~~~~~~~~~~~
node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vitest/dist/config.d.ts:88:18
88 declare function defineConfig(config: UserConfigExport): UserConfigExport;
~~~~~~~~~~~~
The last overload is declared here.
Found 1 error in vitest.config.ts:8
Reproduction
Steps to reproduce
- clone https://github.com/mengxi-ream/read-frog
- upgrade wxt to 0.20.7
- run
pnpm compile(which istsc --noEmit
System Info
System:
OS: macOS 15.2
CPU: (8) arm64 Apple M1 Pro
Memory: 133.17 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
pnpm: 10.10.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
Browsers:
Chrome: 137.0.7151.56
Safari: 18.2
npmPackages:
wxt: ^0.20.7 => 0.20.7Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bug
Activity