liuweiGL/vite-plugin-mkcert

BUG TS: mkcert() plugin type mismatch

pwoloszun opened this issue ยท 4 comments

in package.json:

"typescript": "~4.8.3",
"vite": "~3.1.3",
"vite-plugin-mkcert": "~1.9.0",

in vite.config.ts:

import mkcert from 'vite-plugin-mkcert';

export default defineConfig({
  plugins: [
    mkcert()
  ]
});

throws TS error:

error TS2322: Type 'Plugin_2' is not assignable to type 'PluginOption'.

Try reload your vscode

Try reload your vscode

Does not help.
What is more it throws an error when I build my project.

error TS2322: Type 'Plugin_2' is not assignable to type 'PluginOption'.

Ofc an ugly

as any

fixes it BUT it can be easily fixed in a good way. Just replace custom 'Plugin_2' with vites 'PluginOption' type.

Ugly fix:

import mkcert from 'vite-plugin-mkcert';

export default defineConfig({
  plugins: [
    mkcert() as any // ugly fix
  ]
});

๐ŸŽ‰ This issue has been resolved in version 1.10.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€