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 your favicons inject plugin in my Typescript project. It seems to be working fine, but vscode is complaining about type incompability. Here's my vite.config.ts:
The problem is about the type of the inject plugin, it is not assignable to what vite is expecting to get.
Screenshot of vscode error: https://pasteboard.co/geUM777Z4pbz.png
Here is the full Typescript error:
Type '{ name: string; configResolved(resolvedConfig: any): void; transformIndexHtml(html: any): Promise<any>; closeBundle(): Promise<any[]>; }' is not assignable to type 'PluginOption'.
Type '{ name: string; configResolved(resolvedConfig: any): void; transformIndexHtml(html: any): Promise<any>; closeBundle(): Promise<any[]>; }' is not assignable to type 'Plugin_2'.
Types of property 'closeBundle' are incompatible.
Type '() => Promise<any[]>' is not assignable to type 'ObjectHook<(this: PluginContext) => void | Promise<void>, { sequential?: boolean | undefined; }> | undefined'.
Type '() => Promise<any[]>' is not assignable to type '(this: PluginContext) => void | Promise<void>'.
Type 'Promise<any[]>' is not assignable to type 'void | Promise<void>'.
Type 'Promise<any[]>' is not assignable to type 'Promise<void>'.
Type 'any[]' is not assignable to type 'void'.ts(2322)
Furthermore: Types of property 'closeBundle' are incompatible.
What this means, is that the closeBundle function that your plugin is returning, has returntype of Promise<any[]> whereas vite expects to have Promise<void> or just void.
Any recommendations how to get rid of the type error?
Also, any plans adding Typescript to this project?
The text was updated successfully, but these errors were encountered:
Hi!
I'm using your favicons inject plugin in my Typescript project. It seems to be working fine, but vscode is complaining about type incompability. Here's my vite.config.ts:
The problem is about the type of the inject plugin, it is not assignable to what vite is expecting to get.
Screenshot of vscode error:
https://pasteboard.co/geUM777Z4pbz.png
Here is the full Typescript error:
Furthermore:
Types of property 'closeBundle' are incompatible.
What this means, is that the
closeBundle
function that your plugin is returning, has returntype ofPromise<any[]>
whereas vite expects to havePromise<void>
or justvoid
.Any recommendations how to get rid of the type error?
Also, any plans adding Typescript to this project?
The text was updated successfully, but these errors were encountered: