Skip to content

[Bug]: Components being installed in root of UI folder, instead of subfolder #1188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks
mathieumagalhaes opened this issue Apr 18, 2025 · 4 comments
Open
2 tasks
Labels
bug Something isn't working

Comments

@mathieumagalhaes
Copy link

mathieumagalhaes commented Apr 18, 2025

Reproduction

pnpm dlx shadcn-vue add calendar

Describe the bug

Updated to shadcn-vue latest version for Tailwind v4 support.
Current project is ported and had already some components installed.

After migration I've tried adding the Calendar components with
pnpm dlx shadcn-vue add calendar

This puts files in the root of my UI folder, instead of in the calendar subfolder ?

Outputted files Image

components.json

System Info

System:
    OS: macOS 14.4
    CPU: (12) arm64 Apple M3 Pro
    Memory: 153.80 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.10.0 - /opt/homebrew/bin/node
    npm: 10.9.2 - /opt/homebrew/bin/npm
    pnpm: 10.6.2 - /opt/homebrew/bin/pnpm
  Browsers:
    Safari: 17.4
  npmPackages:
    @vueuse/core: ^13.1.0 => 13.1.0 
    nuxt: ^3.16.2 => 3.16.2 
    shadcn-nuxt: ^2.1.0 => 2.1.0 
    shadcn-vue: ^2.1.0 => 2.1.0 
    vue: ^3.5.13 => 3.5.13

Temporary workaround

While we wait for it to be fixed upstream, a workaround:
Even though 2.1.0 is installed, we can use the CLI of 2.0.1
Use npx shadcn-vue@2.0.1 add ... or pnpm dlx shadcn-vue@2.0.1 add ...

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@mathieumagalhaes mathieumagalhaes added the bug Something isn't working label Apr 18, 2025
@mathieumagalhaes
Copy link
Author

Related issue posted at relatively the same time:
#1187

@etiennea
Copy link

Tailwind v4 does not use tailwind.config.js right? but without that config cli does not work?

@brokuka
Copy link

brokuka commented May 2, 2025

Strange bahavior, for nuxt works as expected.

Image

{
  "$schema": "https://shadcn-vue.com/schema.json",
  "style": "new-york",
  "typescript": true,
  "tailwind": {
    "config": "",
    "css": "assets/css/tailwind.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "aliases": {
    "components": "~/components",
    "composables": "~/composables",
    "utils": "~/utils/lib",
    "ui": "~/components/ui",
    "lib": "~/utils"
  },
  "iconLibrary": "lucide"
}

"reka-ui": "^2.2.0",
"shadcn-nuxt": "2.1.0"

UPDATE:

works while you not change "hardcoded" path, so, if you change back to "ui": "@/components/ui" it's should work

#1102

@xzhonour
Copy link

While we wait for it to be fixed upstream, a workaround:
Even though 2.1.0 is installed, we can use the CLI of 2.0.1
Use npx shadcn-vue@2.0.1 add ... or pnpm dlx shadcn-vue@2.0.1 add ...

This is possible, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants