Skip to content

Conversation

jezzdk
Copy link
Contributor

@jezzdk jezzdk commented Sep 10, 2025

I can't explain why, it's kind of beyond my comprehension, but when running the command npx shadcn@latest add card it only gets the correct component when this config value is an empty string. Could it be something about a missing file? I don't know, but I've spent an hour debugging why it wouldn't fetch the correct component and this fixed it.

Example:

When the value is tailwind.config.js it downloads this:

const Card = React.forwardRef<
  HTMLDivElement,
  React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
  <div
    ref={ref}
    className={cn(
      "rounded-lg border bg-card text-card-foreground shadow-sm",
      className
    )}
    {...props}
  />
))
Card.displayName = "Card"

And when the value is an empty string it gets this:

function Card({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card"
      className={cn(
        "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
        className
      )}
      {...props}
    />
  )
}

@jezzdk jezzdk changed the title Removed the tailwind.config value Removed the tailwind.config value from components.json Sep 10, 2025
@joetannenbaum
Copy link
Contributor

Thanks!

@joetannenbaum joetannenbaum merged commit e05237c into laravel:main Sep 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants