Skip to content

[Bug]: Support Vite v7 Plugin Type #315

@islam-kamel

Description

@islam-kamel

Describe the bug

Latest version of Vite v7 Accept Plugin only as PluginOption Type

Version

v7

Reproduction

install [email protected], Apply Federation Configuration using defineConfig function with typescript

Relevant log output

TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type
({ mode }: ConfigEnv) => {
  server: {
    port: number;
  };
  base: string;
  plugins: (PluginOption[] | Plugin<any>[])[];
}
is not assignable to parameter of type UserConfigExport
Type
({ mode }: ConfigEnv) => {
  server: {
    port: number;
  };
  base: string;
  plugins: (PluginOption[] | Plugin<any>[])[];
}
is not assignable to type UserConfigFnObject
Call signature return types
{
  server: {
    port: number;
  };
  base: string;
  plugins: (PluginOption[] | Plugin<any>[])[];
}
and UserConfig are incompatible.
The types of plugins are incompatible between these types.
Type (PluginOption[] | Plugin<any>[])[] is not assignable to type PluginOption[]
Type PluginOption[] | 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 Plugin<any> is not assignable to type PluginOption
Type Plugin<any> is not assignable to type Plugin$1<any>
Types of property hotUpdate are incompatible.
Type 'ObjectHook<(this: HotUpdatePluginContext, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<void | EnvironmentModuleNode[]>> | undefined' is not assignable to type 'ObjectHook<(this: MinimalPluginContext & { environment: DevEnvironment; }, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<...>> | undefined'.
Type
(this: HotUpdatePluginContext, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<void | EnvironmentModuleNode[]>
is not assignable to type
ObjectHook<(this: MinimalPluginContext & {
  environment: DevEnvironment;
}, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<...>> | undefined
Type
(this: HotUpdatePluginContext, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<void | EnvironmentModuleNode[]>
is not assignable to type
(this: MinimalPluginContext & {
  environment: DevEnvironment;
}, options: HotUpdateOptions) => void | EnvironmentModuleNode[] | Promise<...>
Types of parameters options and options are incompatible.
Property 'environment' is missing in type 'import("projects/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/index").HotUpdateOptions' but required in type 'import("/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/index").HotUpdateOptions'.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions