AI Workshop: learn to build apps with AI →
Debugging Next.js: How to fix the `unable to resolve dependency tree` PostCSS and Tailwind issue in Next.js

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.

  1. Install the current Tailwind and PostCSS packages:
npm install tailwindcss @tailwindcss/postcss postcss
  1. Add the Tailwind PostCSS plugin in postcss.config.mjs:
export default {
  plugins: {
    "@tailwindcss/postcss": {},
  },
}
  1. Import Tailwind in your CSS entry file (for example app/globals.css or styles/globals.css):
@import "tailwindcss";
  1. 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.

Lessons in this unit:

0: Introduction
1: Blank page after router.push() in Next.js?
2: How to fix the error `PrismaClient is unable to be run in the browser` in Next.js
3: Next.js, blank page after calling `res.redirect()`
4: Next.js, how to fix the error `Constructor requires 'new' operator`
5: Next.js, fix the `module not found` error
6: How to fix the `can't resolve module` error in Next.js
7: How to fix error serializing Date object JSON in Next.js
8: ▶︎ How to fix the `unable to resolve dependency tree` PostCSS and Tailwind issue in Next.js
9: Fix “Module not found: Can't resolve encoding” in Next.js
10: How to fix the error "Your custom PostCSS configuration must export a `plugins` key."
11: Next.js, what to do when the state of a component is not refreshed when navigating
12: Revalidation and ISR gotcha on Vercel
13: How to fix the `Already 10 Prisma Clients are actively running` error