Closed Jinjiang closed 2 years ago
VitePress uses the user installed Vue version if possible. But since you've installed vue@2, there will be errors as VitePress is not compatible with it. You can workaround this by using workspaces and installing vitepress and vue3 in docs only. So, rest of your project will be using vue@2, but the docs will use vue@3. Here is an example: https://github.com/brc-dd/vitepress-monorepo-isolation
VitePress uses the user installed Vue version if possible.
I see. Thanks for the explanation.
May I know why we do it in this way? It seems like a non-purpose project config could break it down. BTW, my scenario is to use VitePress in a Vue 2 lib for its docs out-of-box.
May I know why we do it in this way?
So that users can lock Vue version (like to prevent Vue's breaking changes / regressions from affecting their app). It's there since 0.x https://github.com/vuejs/vitepress/commit/9b3243b75752209943af5b247f5d38e641d4ff6d
Totally understood. Anyway, would still be great if there could be an option to isolate the effect from outside easily in that case. 😅
Describe the bug
There would be an runtime error when
vue@2
andvitepress
are installed in the same repo.Reproduction
https://github.com/Jinjiang/vue-a11y-utils/tree/reproduce-vitepress-bug
pnpm install
and thenpnpm run docs
Error log:
Expected behavior
A page with the content "hello" could be opened properly in the browser.
System Info
Additional context
No response
Validations