nextjs - 💡(How to fix) Fix Bug: Tailwind fails with ENOENT for existing file when using Turbopack [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#91943Fetched 2026-04-08 01:35:35
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Code Example

"./app/**/*.{js,ts,jsx,tsx}"

---

* Framework: Next.js 16.2.1 (Turbopack enabled)
* Styling: Tailwind CSS 3.4.19
* Package manager: pnpm
* OS: macOS
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

not available

To Reproduce

  1. Create a Next.js project using Turbopack

  2. Configure Tailwind CSS with a standard content glob:

    "./app/**/*.{js,ts,jsx,tsx}"
  3. Add files under nested route groups and dynamic segments (e.g. [locale], (main))

  4. Start the dev server with pnpm dev

  5. Observe intermittent or persistent ENOENT errors for existing files

Current vs. Expected behavior

Expected behavior

Tailwind should correctly detect and scan existing files without throwing ENOENT errors.


Actual behavior

Tailwind attempts to stat an existing file and fails with ENOENT, breaking the build.


Possible cause

There may be a mismatch between Tailwind’s file tracking (resolveChangedFiles) and Turbopack’s virtual filesystem or watcher, especially with:

  • dynamic route segments ([locale])
  • route groups ((main))

Provide environment information

* Framework: Next.js 16.2.1 (Turbopack enabled)
* Styling: Tailwind CSS 3.4.19
* Package manager: pnpm
* OS: macOS

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

CSS

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

next dev (local)

Additional context

  • Clearing .next and caches DOES resolve the issue
  • The problem appears related to file tracking or invalidation when using Turbopack
  • The issue may be related to how Tailwind tracks changed files in combination with Turbopack’s filesystem layer

extent analysis

Fix Plan

To resolve the ENOENT errors with Tailwind CSS and Turbopack, update the content configuration to include all necessary files and ensure proper file tracking.

  • Update tailwind.config.js to include a more comprehensive content glob:
    module.exports = {
      content: [
        "./app/**/*.{js,ts,jsx,tsx}",
        "./pages/**/*.{js,ts,jsx,tsx}",
        "./components/**/*.{js,ts,jsx,tsx}",
      ],
    };
  • Configure Turbopack to properly track file changes by adding the following to next.config.js:
    module.exports = {
      //... other configurations
      turbopack: {
        // Enable file tracking for Turbopack
        trackChanges: true,
      },
    };
  • If issues persist, try clearing the .next directory and restarting the development server.

Verification

After applying these changes, verify that the fix worked by:

  • Restarting the development server with pnpm dev
  • Checking for ENOENT errors in the console
  • Confirming that Tailwind CSS correctly detects and scans existing files without errors

Extra Tips

  • Regularly clear the .next directory to prevent cache-related issues
  • Ensure that all file paths in the content glob are correct and up-to-date
  • Consider updating Next.js and Tailwind CSS to the latest versions for improved compatibility with Turbopack.

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…

FAQ

Expected behavior

Tailwind should correctly detect and scan existing files without throwing ENOENT errors.


Still need to ship something?

×6

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

Back to top recommendations

TRENDING