Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
This error used to happen when older Next.js versions pulled an outdated PostCSS while Tailwind expected a newer one. In modern Tailwind v4 setups, you should not hit this anymore.
If you do, the fix is to align with the current Next.js + Tailwind install steps and remove old PostCSS packages.
Recommended fix (Tailwind v4)
- Install the current Tailwind and PostCSS packages:
npm install tailwindcss @tailwindcss/postcss postcss
- Add the Tailwind PostCSS plugin in
postcss.config.mjs:
export default {
plugins: {
"@tailwindcss/postcss": {},
},
}
- Import Tailwind in your CSS entry file (for example
app/globals.cssorstyles/globals.css):
@import "tailwindcss";
- Restart the dev server.
If you still see unable to resolve dependency tree, delete node_modules, remove your lockfile, and reinstall with the command above to ensure you are not pinned to old PostCSS versions.