Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind configuration error #658

Closed
shaheermudassar opened this issue May 15, 2024 · 3 comments
Closed

Tailwind configuration error #658

shaheermudassar opened this issue May 15, 2024 · 3 comments
Assignees

Comments

@shaheermudassar
Copy link

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:

  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\postcss-loader\dist\utils.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\postcss-loader\dist\index.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\postcss-loader\dist\cjs.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\loader-runner\lib\loadLoader.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\loader-runner\lib\LoaderRunner.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack\lib\NormalModuleFactory.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack\lib\Compiler.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack\lib\webpack.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack\lib\index.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack-cli\lib\webpack-cli.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack-cli\lib\bootstrap.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack-cli\bin\cli.js
  • C:\Users\Shaheer Mudassar\Desktop\djreact\node_modules\webpack\bin\webpack.js
@pamella
Copy link
Contributor

pamella commented May 16, 2024

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
Copy link
Author

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
Copy link
Contributor

pamella commented May 16, 2024

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

Thank you for all the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants