← Back to resources

March 21, 2026 • Parth Narkar

Fixing ERESOLVE unable to resolve dependency tree in Vite + Tailwind

Step-by-step guide to fix the ERESOLVE dependency tree error when setting up React + Vite + Tailwind CSS projects.

If you are building a React + Vite + Tailwind project, you may face this common error:

ERESOLVE unable to resolve dependency tree

This happens due to version conflicts:

  • Your project may have Vite 8 installed
  • @tailwindcss/vite plugin supports only Vite 5, 6, or 7
  • @vitejs/plugin-react may require Vite 8 → causes conflict

Step-by-Step Fix

1. Remove conflicting Vite / React plugin

npm uninstall vite @vitejs/plugin-react

2. Install compatible versions

npm install -D vite@7
npm install -D @vitejs/plugin-react@5

3. Install Tailwind

npm install tailwindcss @tailwindcss/vite

Configure Vite

vite.config.js:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
  plugins: [react(), tailwindcss()],
})

Setup CSS

Create src/index.css:

@import "tailwindcss";

Import it in main.jsx:

import './index.css';

Done!

Now your project should run perfectly with:

  • Vite 7
  • React plugin v5
  • Tailwind v4 + @tailwindcss/vite

Run:

npm run dev

Your terminal should be green, and Tailwind should work flawlessly.


Tip: Save this guide for future projects - dependency conflicts like this happen often when upgrading Vite or Tailwind!