Skip to content

Type incompatibility with Nuxt 4.3.1 vite.plugins (Plugin<any>[] not assignable to PluginOption) #19729

@ggkovacs

Description

@ggkovacs

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.

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