npmreactjs95% confidence\u2191 25

Tailwind error when installing shadcn in Vite React App

Full error message
I was setting up shadcn in a React App using Vite by using the following command:

npx shadcn@latest init

and I received an error (please see error below). I had installed tailwind and did setup as mentioned on official website.

npm install -D tailwindcss postcss autoprefixer

npx tailwindcss init -p

Error:

No Tailwind CSS configuration found at
/Users/mubashirahmed/Code/shadcn-project.

It is likely you do not have
Tailwind CSS installed or have an invalid configuration.

Install
Tailwind CSS then try again. 

Visit https://tailwindcss.com/docs/guides/vite to get started.

What could be the possible reason for that?

So after some search, I found a fix (from GitHub issues of repo) and the fix is quite simple you just have to add tailwind headers to index.css (global css file) of your project. @tailwind base; @tailwind components; @tailwind utilities; You can see other discussion here as well: https://github.com/shadcn-ui/ui/issues/4677

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/252de0d17a512b99d67833e527e6762f707d9be7dd5cda353f610b2af193074d
hash \u00b7 252de0d17a512b99d67833e527e6762f707d9be7dd5cda353f610b2af193074d
Tailwind error when installing shadcn in Vite React App — DepScope fix | DepScope