Skip to content

Fix Conflict in Tailwind CSS 4 with React 19 and PostCSS  #16200

@Minhajkarim

Description

@Minhajkarim

Dear Tailwind CSS Team,

I am experiencing a build failure when using Tailwind CSS 4 with React 19 and PostCSS. The error message indicates that tailwindcss should not be used directly as a PostCSS plugin and suggests installing @tailwindcss/postcss. However, no such package exists, and following previous PostCSS setup instructions does not resolve the issue.

Steps to Reproduce:

  1. Install Tailwind CSS 4, PostCSS, and Autoprefixer in a React 19 project:
    npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
  2. Run npx tailwindcss init -p.
  3. Start the development server (npm start).

Expected Behavior:
Tailwind CSS should compile without errors and work seamlessly with PostCSS.

Actual Behavior:
The build fails with a PostCSS-related error, preventing the project from running.

Could you please look into this issue and provide a fix or guidance on how to resolve it? Many developers are encountering this problem, and a resolution would be greatly appreciated.

Thank you for your amazing work on Tailwind! 🚀

Best regards,
Minhaj

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions