vintasoftware / django-react-boilerplate

Django 5, React, Bootstrap 5 with Python 3 and Webpack project boilerplate
MIT License
1.94k stars 466 forks source link

Tailwind configuration error #658

Closed shaheermudassar closed 3 months ago

shaheermudassar commented 3 months ago

I wanted to use Tailwind with frontend so i created index.css file and just followed tailwindcss config for react

index.css: @tailwind base; @tailwind components; @tailwind utilities;

and imported that to index.tsx

import App from "./App"; import "./index.css"

but getting this errro on running:

ERROR in ./frontend/js/index.css (./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./frontend/js/index.css) Module Error (from ./node_modules/postcss-loader/dist/cjs.js): Loading PostCSS "postcss-preset-env" plugin failed: Cannot find module 'postcss-preset-env' Require stack:

pamella commented 3 months ago

Hi @shaheermudassar,

You might find that installing the postcss-preset-env package resolves the error you faced. I ran npm install --save-dev postcss-preset-env on my end, and it worked as intended. Could you try that as well and let me know how it goes?

shaheermudassar commented 3 months ago

Hi @shaheermudassar,

You might find that installing the postcss-preset-env package resolves the error you faced. I ran npm install --save-dev postcss-preset-env on my end, and it worked as intended. Could you try that as well and let me know how it goes?

Thanks @pamella I resolved that problem after installing postcss-preset-env. It works perfect and by the way this is a great project. Thanks for you all for providing this awesome boilerplate.

Just a recommendation that you could make a branch for tailwind css too like this bootstrap one. Thanks.

pamella commented 3 months ago

Awesome, glad to hear that installing postcss-preset-env did the trick!

Thank you for all the feedback!