Skip to content

shadcn CLI fails when adding component from external registry URL — requests .../r/styles//button.json (empty style) #177

@rodrigoogalde

Description

@rodrigoogalde

When I try to add a component from an external registry URL, the CLI errors out while fetching a dependency from the official registry. It builds a URL with an empty style segment (styles//button.json), which suggests the CLI isn’t reading style from components.json for this code path.

Command

npx shadcn@latest add https://ui.bazza.dev/r/filters

Output

Checking registry.

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

The component at https://ui.shadcn.com/r/styles//button.json was not found.
It may not exist at the registry. Please make sure it is a valid component.

Environment

  • Node: v22.18.0
  • npm: 11.5.2
  • OS: Ubuntu
  • shadcn CLI: 2.10.0
  • Project type: Next.js + Tailwind + TypeScript

components.json:

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

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions