tailwind css: ⨯ @tailwind base; ^ SyntaxError: Invalid or unexpected token #131180
Replies: 2 comments
-
|
Error: In my case, I found the solution. It was for the following issue:
See the image below. I simply Solution: Version |
Beta Was this translation helpful? Give feedback.
-
|
The error Most common cause: missing or misconfigured Vite needs a PostCSS config to tell it to process Tailwind directives. Create export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}Make sure you have the dependencies installed: npm install -D tailwindcss @tailwindcss/vite autoprefixerFor Vite specifically, the newer Tailwind v4 uses a Vite plugin instead. In your import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [tailwindcss()],
});With Tailwind v4, you replace all three @import "tailwindcss";If you're on Tailwind v3, the The key check: if your CSS file is in |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Body
I'm using Tailwind CSS in my next project. The project is running, but when I change the page or load a certain page, I get an error in the terminal:
⨯ @tailwind base;
^ SyntaxError: Invalid or unexpected token.
The exact error is in the following screenshot.
Can someone help me? I can't deploy to Vercel too due to this error.
It is also showing an 'Unknown at rule @tailwindcss (unknownAtRules)' error, but I'm not sure if it's the cause of the issue.

Guidelines
Beta Was this translation helpful? Give feedback.
All reactions