Summary
Generated shadcn-vue components don't work when they, or the templates that use them, are compiled with Vue Vapor mode (Vue 3.6). We tried an app built with shadcn-vue (new-york-v4 style) under Vapor and hit two problems:
- About half of the generated components break when compiled as Vapor, because they call reka-ui's forwarding helpers, which rely on
getCurrentInstance(). as-childfrom a Vapor template never wires the trigger, even when the shadcn-vue components themselves are compiled as VDOM.
We'd like to ask whether Vapor compatibility is on the roadmap for shadcn-vue, and how it relates to reka-ui v3's useRender work.
Environment
- Vue 3.6.0-rc.13,
@vitejs/plugin-vue6.0.10 (features: { vapor: true }),vaporInteropPlugin - shadcn-vue CLI 2.9.0, style
new-york-v4 - reka-ui 2.11.0
- Chromium, Vitest browser mode
1. Components compiled as Vapor: forwarding helpers get the wrong instance
The generated wrappers call reka-ui's useForwardProps, useForwardPropsEmits, useEmitAsProps and useForwardExpose. These read getCurrentInstance() (vm.type.props, , ). In Vue 3.6, returns or the currently rendering VDOM instance inside a Vapor , so the helpers forward nothing, forward another component's props and emits (warnings name the wrong component), or crash.