Failed to load PostCSS config: Failed to load PostCSS config . I checked again and again and got to know that i have to install post css to run my vite react project without it doesnt runs. #16600
Unanswered
KanhaSahu-dev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have to install postcss , then i have to create a postcss.config.js file then only the project runs but isn't vite allows whatever preprocessor we can install and sometimes we dont even need a preprocessor . Is it mandatory??
I also checked other help discussions there people said if tailwindcss module is in the parent directory then running in child may rise to error and they deleted that but in my case i opened a enirely new folder and ran the problem exists as long as the postcss.config.js isnt installed but why ?
PS D:\WEB-SELF-LEARNING\REACT\08miniContext> npm run dev
VITE v5.2.11 ready in 884 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
[Failed to load PostCSS config: Failed to load PostCSS config (searchPath: D:/WEB-SELF-LEARNING/REACT/08miniContext): [Error] Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
Require stack:
(@d:\postcss.config.js)
Error: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
Require stack:
(@d:\postcss.config.js)
at load (file:///D:/WEB-SELF-LEARNING/REACT/08miniContext/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:29093:11)
at file:///D:/WEB-SELF-LEARNING/REACT/08miniContext/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:29118:16
at Array.map ()
at plugins (file:///D:/WEB-SELF-LEARNING/REACT/08miniContext/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:29117:8)
at processResult (file:///D:/WEB-SELF-LEARNING/REACT/08miniContext/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:29187:14)
at file:///D:/WEB-SELF-LEARNING/REACT/08miniContext/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:29317:14]
Node.js v22.1.0
This is my vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
Beta Was this translation helpful? Give feedback.
All reactions