DEV Community

Discussion on: How to use Tailwind with Create React App and PostCSS with no hassle

Collapse
 
girlsincode profile image
Violeta

Failed to compile

./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/react-scripts/node_modules/postcss-loader/src??postcss!./src/index.css)
Error: PostCSS plugin tailwindcss requires PostCSS 8.
Migration guide for end-users:
github.com/postcss/postcss/wiki/Po...

Collapse
 
andrewmcodes profile image
Andrew Mason

Tailwind >v2.0 requires PostCSS 8. You should just be able to run yarn add -D postcss and have it working.

Collapse
 
sumitgupta07 profile image
sumitgupta07

This is not working for me either. Followed all steps. Below are my packages.
"@craco/craco": "^6.0.0",
"autoprefixer": "^10.2.1",
"postcss": "^8.2.3",
"postcss-cli": "^8.3.1",
"postcss-nested": "^5.0.3",
"tailwindcss": "^2.0.2"

Collapse
 
zbendas profile image
Zachariah Bendas

Currently Create React App does not support PostCSS 8.

If you still want to use Tailwind with CRA, you'll need to use their compatibility branch for PostCSS 7. You can find instructions for that in the Tailwind installation docs.