v4 vite PostCSS plugin error when app root folder contains a hyphen [-] #16534
-
It appears that using the @tailwindcss/vite plugin, when app root folder contains a hyphen [-] the following error is thrown. [postcss] It looks like you're trying to use node_modules/tailwindcss/dist/lib.js:33:1716 is where the final error is thrown. What version of Tailwind CSS are you using? 4.0.6 What build tool (or framework if it abstracts the build tool) are you using? Vite 6.1.0 What version of Node.js are you using? 22 What browser are you using? N/A What operating system are you using? macOS my use case happens to be when using react-router, but I've tracked it down to what appears to be the @tailwindcss/vite plugin. Steps to reproduce: 🔴 mkdir local-app
cd local-app
npx create-react-router .
npm i This creates a vite.config.ts that includes: import tailwindcss from "@tailwindcss/vite";
...
export default defineConfig({
plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
});
Steps to reproduce: 🟢 mkdir localapp
cd localapp
npx create-react-router .
npm i
downgrading to tailwindcss@3 and not using the v4 plugin or removing the hyphen from the root folder name both resolves the issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! It looks like you for some reason still use Tailwind CSS as a Post CSS plugin somewhere. However, when I try to run |
Beta Was this translation helpful? Give feedback.
Hey! It looks like you for some reason still use Tailwind CSS as a Post CSS plugin somewhere. However, when I try to run
create-react-router
to set up a new app it will use the Vite setup and works fine. Do you have a postcss config file lying around?