nextjs - 💡(How to fix) Fix Tailwind CSS v3 not compatible with Next.js 15 + Turbopack? (Module not found: Can't resolve 'fs') [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#84256Fetched 2026-04-08 02:20:12
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Error Message

When using Tailwind CSS v3 with Next.js 15 and Turbopack, the build fails immediately with the following error:

Code Example

"next": "15.5.4"
 "react": "19.1.0"
 "node": "v24.8.0",
 "npm":" "11.6.0"
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/GanziMan/tech-talk

To Reproduce

  1. Create a new Next.js 15 project
  2. Enable Turbopack (next dev --turbo)
  3. Install tailwindcss@3 and configure PostCSS
  4. Run dev server

Current vs. Expected behavior

Tailwind CSS v3 should compile successfully under Turbopack, or the compatibility limitation should be documented.

Provide environment information

"next": "15.5.4"
 "react": "19.1.0"
 "node": "v24.8.0",
 "npm":" "11.6.0"

Which area(s) are affected? (Select all that apply)

CSS

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

When using Tailwind CSS v3 with Next.js 15 and Turbopack, the build fails immediately with the following error:

Module not found: Can't resolve 'fs'

However, the exact same setup works fine when upgrading to Tailwind CSS v4.

<img width="861" height="773" alt="Image" src="https://github.com/user-attachments/assets/8dc52701-0115-4f7b-8ca6-8ecb8de95a51" />

extent analysis

TL;DR

  • The issue can likely be resolved by upgrading to Tailwind CSS v4, as the same setup works fine with this version.

Guidance

  • Verify that the error Module not found: Can't resolve 'fs' is indeed caused by the compatibility issue between Tailwind CSS v3 and Turbopack in Next.js 15.
  • Check the documentation of Tailwind CSS and Next.js for any known compatibility limitations or issues with Turbopack.
  • Try upgrading to Tailwind CSS v4 to see if the issue is resolved, as indicated by the fact that the same setup works fine with this version.
  • If upgrading is not feasible, investigate alternative solutions, such as using a different CSS framework or configuring PostCSS to work around the compatibility issue.

Example

  • No code snippet is provided as the issue is more related to compatibility and configuration rather than a specific code problem.

Notes

  • The issue seems to be specific to the combination of Tailwind CSS v3, Next.js 15, and Turbopack, and may not affect other versions or configurations.
  • The fact that upgrading to Tailwind CSS v4 resolves the issue suggests that this is a compatibility problem that has been addressed in the later version.

Recommendation

  • Apply workaround: Upgrade to Tailwind CSS v4, as this version is known to work with the same setup and resolves the compatibility issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING