emersonbottero/vitepress-plugin-mermaid

TypeError for withMermaid config arguments

aeyll-11 opened this issue · 6 comments

Hello, I encountered this type error while employing defineConfig within the context of withMermaid.

Argument of type 'UserConfigExport<Config>' is not assignable to parameter of type 'UserConfig<any>'.
Type 'Promise<UserConfig<Config>>' has no properties in common with type 'UserConfig<any>'.ts(2345)

defineConfig in Vitepress yields UserConfigExport<DefaultTheme.Config> rather than a UserConfig

declare function defineConfig(config: UserConfigExport<DefaultTheme.Config>): UserConfigExport<DefaultTheme.Config>;
brc-dd commented

defineConfig is not needed if you're using withMermaid

brc-dd commented

That's probably to provide hints for theme part. But which vitepress version are you on? It doesn't use UserConfigExport for defineConfig.

I use "vitepress": "^1.0.0-beta.2"
line 41
https://github.com/vuejs/vitepress/blob/main/src/node/config.ts

brc-dd commented

That is just exported no longer used by defineConfig or anything. And IIRC beta 2 was the only version having that. Update your version to rc or something.

Thanks for the answer mate @brc-dd