Tailwind v4 "PostCSS plugin moved" - Fix in CI
Tailwind v4 split the PostCSS integration into @tailwindcss/postcss. Configs that still register tailwindcss directly as a PostCSS plugin now error.
What this error means
After upgrading to Tailwind v4 the build fails telling you the PostCSS plugin has moved to a separate package.
node
Error: It looks like you're trying to use `tailwindcss` directly as a
PostCSS plugin. The PostCSS plugin has moved to a separate package.
Install `@tailwindcss/postcss` and update your PostCSS configuration.Common causes
Old PostCSS config after v4 upgrade
Your postcss.config.js still lists tailwindcss: {} as a plugin, which is the v3 shape.
Missing @tailwindcss/postcss
The v4 PostCSS package was not installed during the upgrade.
How to fix it
Install and register the new plugin
- Install @tailwindcss/postcss.
- Reference it in the PostCSS config instead of tailwindcss.
Terminal
npm install -D @tailwindcss/postcssUpdate postcss.config.js
- Replace the v3 plugin entry with the v4 package.
postcss.config.js
// postcss.config.js
module.exports = { plugins: { '@tailwindcss/postcss': {} } };How to prevent it
- Read the Tailwind v4 upgrade guide before bumping the major.
- Pin Tailwind and its PostCSS package to the same major version.
Frequently asked questions
What causes "v4 plugin moved"?
Your postcss.config.js still lists tailwindcss: {} as a plugin, which is the v3 shape.
How do I fix v4 plugin moved?
Install and register the new plugin
Related guides
Tailwind "Cannot apply unknown utility class" - Fix in CIFix Tailwind "Cannot apply unknown utility class" in CI - an @apply references a class that is not generated,…
Tailwind Empty CSS - content Option Missing in CIFix Tailwind producing empty/unstyled CSS in CI - the content (or v3 purge) globs miss your templates, so eve…
PostCSS "plugin requires PostCSS 8" - Fix in CIFix "requires PostCSS 8" in CI - a plugin expects PostCSS 8 but a tool pulled in PostCSS 7; deduplicate and u…