Skip to content

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

Closed
@nathanburgess

Description

@nathanburgess

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions