#1955·shadcn-vue

[Bug]: Failed to install sidebar-01 in pure JS project: [@vue/compiler-sfc] Failed to resolve import source "."

Author: gitDebianDCreated Sep 5, 2026Updated Sep 5, 2026
Labelsbug

Reproduction

Create a new Vue 3 + Vite project (using JavaScript, not TypeScript). Install and configure Tailwind CSS v4. Run npx shadcn-vue@latest init (with default settings or typescript: false). Run npx shadcn-vue@latest add sidebar-01. The process will throw an error immediately.

Describe the bug

I am using a Vue 3 + Vite project with Tailwind CSS v4, and it is a pure JavaScript project (no TypeScript). After running npx shadcn-vue@latest init, I tried to add the sidebar block by running npx shadcn-vue@latest add sidebar-01, but the installation failed.

The error points to the generated Sidebar.vue file: [@vue/compiler-sfc] Failed to resolve import source ".". registry/new-york-v4/ui/sidebar/Sidebar.vue 14 | const props = withDefaults(defineProps(), { | ^^^^^^^^^^^^

It seems the CLI might have failed to correctly transpile the TypeScript syntax (specifically defineProps()) into JavaScript for a pure JS project, leading to a Vue compiler failure when trying to resolve the relative import source ".". This bug persists even after installing TypeScript locally.

System Info

bash
npx envinfo --system --npmPackages vue,vueuse/core,radix-vue,reka-ui,nuxt,shadcn-vue --binaries --browsers

  System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-13400
    Memory: 22.62 GB / 47.72 GB
  Binaries:
    Node: 24.15.0 - E:\Program Files\nodejs\node.EXE
    npm: 11.12.1 - E:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 152.0.7977.65
    Edge: Chromium (151.0.4129.93)
  npmPackages:
    reka-ui: ^2.10.4 => 2.10.4
    vue: ^3.5.40 => 3.5.42

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests