#Internal server error: Failed to load PostCSS config

1 messages · Page 1 of 1 (latest)

odd zealot
#

Has anyone seen this error before when using the following command? npm create vite@latest mission-app-test -- --template react . I've tried JS and TS versions of the templates too and get the same issue

#

I've tried several times such as going ahead of setting up tailwind v4 anyways to see if fixes it but doesn't for me and watched a guy do it and it worked straight away!

All get exact same error

npm: 10.9.2
node: v22.14.0

Have also tried several node/npm versions too

Internal server error: Failed to load PostCSS config (searchPath: C:/Users/charl/Projects/metronome/frontend/mission-app-test): [Error] Cannot find module 'tailwindcss'
hidden haven
#

Hmm Tailwind v4 doesn't use PostCss any more

#

Do you see a Postcss config file ?

odd zealot
#

No that's what's bizarre

#

The tailwind version in the project is v4 as well. Have tried creating multiple different projects and same happens. Even tried rolling back version of vite too

hidden haven
#

Can you share a reproduction Github repository ? I can try to see if it works on my machine

odd zealot
#

Sure I’ll need to push it up tomorrow

odd zealot
hidden haven
#

The default React template doesn't include Tailwind.
I took some extra steps to add TailwindCss. And it worked on my machine, so I'm not sure why it doesn't work on yours

  1. npm create vite@latest mission-app-test -- --template react
  2. cd mission-app-test && npm install
  3. npm install tailwindcss @tailwindcss/vite
  4. Add Tailwindcss plugin to vite.config.js
  5. Delete entire content index.css and replace with @import 'tailwindcss';
  6. Add bg-red-400 on a random <button> in src/App.jsx
  7. Visit http://localhost:5173 --> Everything is okay and the button is red
odd zealot
#

Thank you. So it turned out because I have a monorepo it was somehow picking up postcss config in the root of the project which was bizarre considering it was 2 directories away from where this was being ran