-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
Environment
- Nuxt: 4.3.1
- Vite: 7.3.1
- @tailwindcss/vite: 4.2.1
Description
When using @tailwindcss/vite inside a Nuxt 4.3.1 project, TypeScript reports a type error when adding the plugin to vite.plugins in nuxt.config.ts.
Example:
import tailwindcss from '@tailwindcss/vite'
export default defineNuxtConfig({
vite: {
plugins: [
tailwindcss(),
],
},
})TypeScript error:
Type 'Plugin<any>[]' is not assignable to type 'PluginOption'.
...
Property 'viteVersion' is missing in type 'PluginContextMeta'
Notes
- Only one version of Vite is installed.
- Runtime behavior is correct.
- The issue appears to be caused by a type identity mismatch between:
- the Plugin type exported by @tailwindcss/vite
- and the PluginOption type expected by Nuxt’s Vite builder
The incompatibility surfaces in the hotUpdate hook’s this context typing, specifically around MinimalPluginContext and PluginContextMeta.
Workaround
Casting resolves the issue:
import tailwindcss from '@tailwindcss/vite'
export default defineNuxtConfig({
vite: {
plugins: [
tailwindcss(),
] as any,
},
})Expected Behavior
The plugin should be assignable to vite.plugins in Nuxt 4.3.1 without requiring manual type casting.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels