liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
541 stars 37 forks source link

BUG TS: mkcert() plugin type mismatch #44

Closed pwoloszun closed 1 year ago

pwoloszun commented 1 year ago

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 'Plugin2' is not assignable to type 'PluginOption'.

liuweiGL commented 1 year ago

Try reload your vscode

pwoloszun commented 1 year ago

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'.

pwoloszun commented 1 year ago

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
  ]
});
liuweiGL commented 1 year ago

:tada: This issue has been resolved in version 1.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: