Issue with Upgrade from Tailwind v2 to v3 React Js using Craco
tailwindcss v3 only supports Postcss8 and only create-react-app v5 supports Postcss8 for now. So you need to upgrade the create-react-app to v5. No need for craco in create-react-app v5 as well
First make sure to checkout to different branch or push your code to github before migrating, just for safety.
1.First run npm uninstall @craco/craco autoprefixer postcss tailwindcss
Delete the craco.config.js file
Delete the tailwind.config.js
Now just follow the offical tailwindcss docs
2. Run npm install -D tailwindcss postcss autoprefixer
3. npx tailwindcss init -p
copy paste the tailwind.config.js file from tailwindcss docs
4. npm install react-scripts@latest
5. Now npm start
Later paste your previous tailwind.config theme in the new tailwind.config.js file.
The order of steps may or may not matter but following this steps worked for me.