Skip to content
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

[bug]: CLI not respecting settings in components.json #6386

Open
2 tasks done
nathanburgess opened this issue Jan 17, 2025 · 1 comment
Open
2 tasks done

[bug]: CLI not respecting settings in components.json #6386

nathanburgess opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@nathanburgess
Copy link

nathanburgess commented Jan 17, 2025

Describe the bug

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "new-york",
  "rsc": false,
  "tsx": true,
  "tailwind": {
    "config": "tailwind.config.ts",
    "css": "app/app.css",
    "baseColor": "zinc",
    "cssVariables": true,
    "prefix": "",
    "tsx": true
  },
  "aliases": {
    "components": "~/app/components",
    "utils": "~/app/utilities",
    "ui": "~/app/components/ui",
    "lib": "~/app/utilities",
    "hooks": "~/app/hooks"
  },
  "iconLibrary": "lucide"
}

I have this for my components.json and whenever I install a new component the import for cn is always import { cn } from "~/lib/utils"

Affected component/components

CLI

How to reproduce

  1. Install shadcn
  2. Modify components.json with a new utils alias
  3. Install any component (i.e.: pnpm dlx shadcn@latest add checkbox)
  4. Open the checkbox and see that the config wasn't respected

Codesandbox/StackBlitz link

No response

Logs

System Info

MacOS, Vite, React Router 7

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@nathanburgess nathanburgess added the bug Something isn't working label Jan 17, 2025
@ander-rentcars
Copy link

I'm having the same problem with turbopack design-system example. Could be a pnpm issue?

My components.json aliases:

"aliases": {
        "components": "@acme/ui/components",
        "utils": "@acme/ui/lib/utils",
        "hooks": "@acme/ui/hooks",
        "lib": "@acme/ui/lib",
        "ui": "@acme/ui/components"
    },

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

2 participants