Home · Topic · 4 entries
Tailwind CSS v4 not working? Upgrade errors fixed
Tailwind CSS v4 moved the CLI, the PostCSS plugin and the configuration into new places, so commands and setups that worked on v3 now fail with errors that older answers do not cover. Every entry below was reproduced on a fresh v4 project, with the fix run and verified.
- No.018
Fix: Failed to load PostCSS config (module is not defined) in Vite
Vite can't load your PostCSS config, sometimes one you didn't know existed. The three causes, how to tell which you have from the message, and what fixes each.
> [plugin vite:css] C:/project/src/style.css
FIXED3 min - No.009
Fix: “trying to use tailwindcss directly as a PostCSS plugin”
Tailwind v4 broke your PostCSS build. The two-line config change that fixes it, and the half-fix that keeps failing. Reproduced and verified.
> Error: It looks like you're trying to use `tailwindcss` directly as a PostCSS
FIXED1 min - No.008
Cannot apply unknown utility class border-border in Tailwind v4
Two different causes trigger this Tailwind v4 error, and they need different fixes. How to tell which one you have. Both reproduced and fixed.
> Error: Cannot apply unknown utility class `border-border`
FIXED2 min - No.007
Fix: npx tailwindcss init “could not determine executable to run”
npx tailwindcss init fails on a fresh install. Why Tailwind v4 does this, two fixes that work, and the command that fails silently. Reproduced.
> $ npx tailwindcss init
FIXED2 min
Post card · Newsletter
Get the next fix in your inbox.
One short email when a new entry is published. No spam, never shared, and you can leave any time.
— Nilay