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:
Affected component/components
All
How to reproduce
- Create a Vite project
- Make changes as described on Vite installation docs
- 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
- docs(vite installation):No tailwind css configuration found #5216 — committed to Shrikanthpawar/ui by Shrikanthpawar 2 years ago
- docs(vite installation):No tailwind css configuration found #5216 — committed to Shrikanthpawar/ui by Shrikanthpawar 2 years ago
- docs(vite installation):No tailwind css configuration found #5216 — committed to Shrikanthpawar/ui by Shrikanthpawar 2 years ago
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.
The following code in
index.csswould cause the errorBut the following code in
index.cssworks for meUpdate - 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.
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.