ui: [bug]: No tailwind css configuration found

Describe the bug

I have created a new Vite project and made all the changes as described on shadcn docs but after using npx shadcn@latest init the command, I am getting an error. That’s why I am not able to use shadcn components.

Following error will be displayed:

image

Affected component/components

All

How to reproduce

  1. Create a Vite project
  2. Make changes as described on Vite installation docs
  3. Use command npx shadcn@latest init

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Windows 11
Node v22.9.0

Before submitting

  • I’ve made research efforts and searched the documentation
  • I’ve searched for existing issues

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

Had the same issue but managed to make it work by adding the tailwind directives to index.css. Looks to me like the shadcn docs are missing a step.

@tailwind base;
@tailwind components;
@tailwind utilities;

The following code in index.css would cause the error

@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

But the following code in index.css works for me

@tailwind base;
@tailwind components;
@tailwind utilities;

Not sure if anybody else has this issue, but I’m installing shadcn in an Nx monorepo where I have multiple tailwind.config.js. Just tried to update shadcn/ui, but it’s saying that there’s no tailwind.config.js in the root directory. How can I work around this? Happy to open up a new issue if need be, but figured this was something minor.

Same here, I tried to installing shadcn in nx monorepo in my apps/web app which is a Nextjs app and have both files tailwind.config.js and postcss.config.js but getting same error. Do you got any solution ?

Update - It worked for me by temporarily installing tailwindcss inside apps/web to make it work, then removing it and running pnpm install in the root so it uses the root tailwindcss. This trick helped me with NX monorepo using Next.js 15. I think it’s a temporary workaround.

Not sure if anybody else has this issue, but I’m installing shadcn in an Nx monorepo where I have multiple tailwind.config.js. Just tried to update shadcn/ui, but it’s saying that there’s no tailwind.config.js in the root directory. How can I work around this?

Happy to open up a new issue if need be, but figured this was something minor.

Same here, I tried to installing shadcn in nx monorepo in my apps/web app which is a Nextjs app and have both files tailwind.config.js and postcss.config.js but getting same error. Do you got any solution ?

Install tailwind first then use the shadcn command

https://tailwindcss.com/docs/guides/vite

How do you circumvent this problem in Next.js?

Not sure if anybody else has this issue, but I’m installing shadcn in an Nx monorepo where I have multiple tailwind.config.js. Just tried to update shadcn/ui, but it’s saying that there’s no tailwind.config.js in the root directory. How can I work around this?

Happy to open up a new issue if need be, but figured this was something minor.