nextjs - 💡(How to fix) Fix [Turbopack] FATAL panic on Windows: PostCSS/Tailwind CSS v4 attempts to read `nul` device causing os error 1 [3 comments, 3 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#90860Fetched 2026-04-08 00:19:22
View on GitHub
Comments
3
Participants
3
Timeline
10
Reactions
0
Author
Timeline (top)
commented ×3labeled ×2referenced ×2closed ×1

Error Message

Visit http://localhost:3000 → 500 error with Turbopack panic

Current: Turbopack panics with a FATAL error every time a page is loaded. The panic log reveals that the PostCSS transformer attempts to read the Windows reserved device name nul as a file path: 功能錯誤。 (os error 1)

  • 功能錯誤。 (os error 1)
  • 功能錯誤。 (os error 1) The PostCSS transform pipeline (likely source map generation) produces a reference to nul — which is a valid "null device" path on Unix (/dev/null) but is a reserved device name on Windows. When Turbopack's DiskFileSystem::read tries to open C:\...\nul, Windows returns OS error 1 ("Incorrect function").

Root Cause

Caused by:

  • [project]/src/app/globals.css [app-client] (css)
  • reading file C:\Users...\Projects\flow2code\nul
  • 功能錯誤。 (os error 1)

Fix Action

Fix / Workaround

Workaround: Use next dev --webpack to force the webpack bundler instead of Turbopack.

Code Example

npx create-next-app@latest my-app --tailwind
cd my-app
pnpm dev
# Visit http://localhost:3000500 error with Turbopack panic

---

reading file C:\Users\...\Projects\flow2code\nul
功能錯誤。 (os error 1)

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11

Binaries:
  Node: 22.x
  pnpm: 10.x

Relevant Packages:
  next: 16.1.6
  react: 19.x
  @tailwindcss/postcss: 4.2.1
  tailwindcss: 4.2.1
  postcss: 8.5.6

---

Failed to write app endpoint /page

Caused by:
- [project]/src/app/globals.css [app-client] (css)
- reading file C:\Users\...\Projects\flow2code\nul
- 功能錯誤。 (os error 1)

Debug info:
- Execution of get_written_endpoint_with_issues_operation failed
- Execution of endpoint_write_to_disk failed
- Execution of <AppEndpoint as Endpoint>::output failed
- Execution of AppProject::app_module_graphs failed
- Execution of SingleModuleGraph::new_with_entries_visited_intern failed
- [project]/src/app/globals.css [app-client] (css)
- Execution of parse_css failed
- Execution of <PostCssTransformedAsset as Asset>::content failed
- Execution of PostCssTransformedAsset::process failed
- Execution of evaluate_webpack_loader failed
- Execution of <DiskFileSystem as FileSystem>::read failed
- reading file C:\Users\...\Projects\flow2code\nul
- 功能錯誤。 (os error 1)

---

const config = { plugins: ["@tailwindcss/postcss"] };
export default config;

---

@import "tailwindcss";
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/timo9378/flow2code

To Reproduce

  1. On Windows, create a Next.js 16 project with Tailwind CSS v4 + @tailwindcss/postcss
  2. Run next dev (Turbopack is the default bundler in Next.js 16)
  3. Visit http://localhost:3000

Minimal reproduction:

npx create-next-app@latest my-app --tailwind
cd my-app
pnpm dev
# Visit http://localhost:3000 → 500 error with Turbopack panic

Current vs. Expected behavior

Current: Turbopack panics with a FATAL error every time a page is loaded. The panic log reveals that the PostCSS transformer attempts to read the Windows reserved device name nul as a file path:

reading file C:\Users\...\Projects\flow2code\nul
功能錯誤。 (os error 1)

This creates an actual empty file named nul in the project root directory.

Expected: The page should compile and render normally. The PostCSS/Tailwind pipeline should not attempt to read nul as a file path on Windows.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11

Binaries:
  Node: 22.x
  pnpm: 10.x

Relevant Packages:
  next: 16.1.6
  react: 19.x
  @tailwindcss/postcss: 4.2.1
  tailwindcss: 4.2.1
  postcss: 8.5.6

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

Turbopack

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

next dev (local)

Additional context

Full panic stack trace:

Failed to write app endpoint /page

Caused by:
- [project]/src/app/globals.css [app-client] (css)
- reading file C:\Users\...\Projects\flow2code\nul
- 功能錯誤。 (os error 1)

Debug info:
- Execution of get_written_endpoint_with_issues_operation failed
- Execution of endpoint_write_to_disk failed
- Execution of <AppEndpoint as Endpoint>::output failed
- Execution of AppProject::app_module_graphs failed
- Execution of SingleModuleGraph::new_with_entries_visited_intern failed
- [project]/src/app/globals.css [app-client] (css)
- Execution of parse_css failed
- Execution of <PostCssTransformedAsset as Asset>::content failed
- Execution of PostCssTransformedAsset::process failed
- Execution of evaluate_webpack_loader failed
- Execution of <DiskFileSystem as FileSystem>::read failed
- reading file C:\Users\...\Projects\flow2code\nul
- 功能錯誤。 (os error 1)

Root cause analysis: The PostCSS transform pipeline (likely source map generation) produces a reference to nul — which is a valid "null device" path on Unix (/dev/null) but is a reserved device name on Windows. When Turbopack's DiskFileSystem::read tries to open C:\...\nul, Windows returns OS error 1 ("Incorrect function").

A nul file is also physically created in the project directory as a side effect.

Workaround: Use next dev --webpack to force the webpack bundler instead of Turbopack.

Affected config:

postcss.config.mjs:

const config = { plugins: ["@tailwindcss/postcss"] };
export default config;

globals.css:

@import "tailwindcss";

extent analysis

Fix Summary

The panic is caused by the PostCSS transformer trying to read a Windows‑reserved file name nul that appears when Tailwind is imported with @import "tailwindcss" (or when source‑maps are generated).
Replace the import with the proper Tailwind directives and disable source‑map generation for PostCSS on Windows.


Step‑by‑Step Fix Plan

1

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

nextjs - 💡(How to fix) Fix [Turbopack] FATAL panic on Windows: PostCSS/Tailwind CSS v4 attempts to read `nul` device causing os error 1 [3 comments, 3 participants]