The issue involves a specific Node.js version interaction with fetch that crashes on error responses.
The issue occurs when passing a Request object with a body to fetch in Node.js >= 24.14.0, causing a crash on error responses. The fix likely involves adjusting how the patched fetch handles Request objects with bodies during error responses. The main blocker is understanding Next.js's fetch patching mechanism.
https://github.com/masakij/nextjs-expected-non-null-body-source-repro
The reproduction is very simple. Execute this inside an App Router handler (e.g., Server Action or Route Handler) targeting an endpoint that returns a 4xx or 5xx error:
// 1. Create a Request object with a body
const req = new Request('https://httpstat.us/401', { // An endpoint that returns 401
method: 'POST',
body: JSON.stringify({ test: true }),
headers: { 'Content-Type': 'application/json' }
});
// 2. Pass the Request object directly to global fetch
// 💥 This crashes immediately on Node >= 24.14.0 when the response is an error
const res = await fetch(req);
The patched fetch should return the Response object with res.ok === false without crashing, just as it does in a pure Node.js environment.
The application crashes with TypeError: expected non-null body source at ignore-listed frames.
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:31 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T8122
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 24.14.0
npm: 11.9.0
Yarn: N/A
pnpm: 10.29.3
Relevant Packages:
next: 16.1.6 // Latest available version is detected (16.1.6).
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: standalone
Not sure
next dev (local)
In the App Router environment, using the global patched fetch crashes with TypeError: expected non-null body source under a very specific set of conditions:
You pass a Request object (that contains a body, e.g., POST/PUT) dir
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!