unovue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
5.27k stars 315 forks source link

[Bug]: auto form doesn't work with Nuxt when SSR is turned off #697

Closed HuakunShen closed 3 months ago

HuakunShen commented 3 months ago

Reproduction

https://github.com/HuakunShen/shadcn-auto-form-debug

Describe the bug

When ssr: false, in Nuxt, I get error.

The requested module '/_nuxt/node_modules/.pnpm/@vue+devtools-api@6.6.3/node_modules/@vue/devtools-api/lib/cjs/index.js' does not provide an export named 'setupDevtoolsPlugin'

ssr: true may also cause error

System Info

System:
    OS: macOS 15.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.20 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.1 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.1 - /opt/homebrew/bin/npm
    pnpm: 9.6.0 - /usr/local/bin/pnpm
    bun: 1.1.21 - ~/.bun/bin/bun
  Browsers:
    Chrome: 124.0.6367.119
    Edge: 127.0.2651.74
    Safari: 18.0
  npmPackages:
    @vueuse/core: ^10.11.0 => 10.11.0 
    nuxt: ^3.12.4 => 3.12.4 
    radix-vue: ^1.9.2 => 1.9.2 
    shadcn-nuxt: ^0.10.4 => 0.10.4 
    vue: latest => 3.4.35

Contributes

HuakunShen commented 3 months ago

This seems to be a pnpm-only problem. When I use npm, it works.

Error may come from vee-velidate.

https://github.com/nuxt/nuxt/issues/27544

Add @vue/devtools-api fix the error.