nextjs - 💡(How to fix) Fix [Turbopack] POST requests from client components to API routes never reach server in Next.js 16 [2 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#88917Fetched 2026-04-08 02:03:41
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2issue_type_added ×1labeled ×1

Fix Action

Fix / Workaround

GET requests to API routes work fine POST requests to the same route work intermittently when the server first starts, before Turbopack fully initializes Middleware is configured to exclude /api routes:

export const config = {
  matcher: ["/((?!api|_next/static|_next/image|favicon.ico|login).*)"],
};

Workarounds attempted:

Code Example

import { NextResponse } from "next/server";

export async function POST(request: Request) {
  const body = await request.json();
  console.log('API route hit:', body);
  return NextResponse.json({ success: true });
}

---

Run next dev (Turbopack enabled by default in Next.js 16)
Click the button
Observe: Browser logs "Fetching..." but server terminal never logs the request

### Current vs. Expected behavior

Expected: POST request reaches the API route handler and server logs show:

POST /api/test 200 in XXms
Actual:

Browser console shows fetch is called with correct URL and payload
Request appears in browser Network tab as "pending" indefinitely
Server terminal shows NO log of the incoming request
Request never completes or times out
Browser Console:

Fetching...
# Request hangs here forever
Server Terminal:

Next.js 16.1.4 (Turbopack)
- Local:         http://localhost:3000

Ready in 548ms
GET /some-page 200 in 3.0s
# POST /api/test never appears

### Provide environment information

---

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

Turbopack

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

next dev (local)

### Additional context

GET requests to API routes work fine
POST requests to the same route work intermittently when the server first starts, before Turbopack fully initializes
Middleware is configured to exclude /api routes:
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/createdbymax/nextjs-turbopack-post-bug

To Reproduce

  1. Create a Next.js 16.1.4 app with App Router
  2. Create an API route at src/app/api/test/route.ts:
import { NextResponse } from "next/server";

export async function POST(request: Request) {
  const body = await request.json();
  console.log('API route hit:', body);
  return NextResponse.json({ success: true });
}

Create a client component with a button that calls the API:

"use client";

export function TestComponent() { const handleClick = async () => { console.log('Fetching...'); const response = await fetch('/api/test', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'data' }), }); console.log('Response:', response.status); };

return <button onClick={handleClick}>Test API</button>; }


Run next dev (Turbopack enabled by default in Next.js 16)
Click the button
Observe: Browser logs "Fetching..." but server terminal never logs the request

### Current vs. Expected behavior

Expected: POST request reaches the API route handler and server logs show:

POST /api/test 200 in XXms
Actual:

Browser console shows fetch is called with correct URL and payload
Request appears in browser Network tab as "pending" indefinitely
Server terminal shows NO log of the incoming request
Request never completes or times out
Browser Console:

Fetching...
# Request hangs here forever
Server Terminal:

▲ Next.js 16.1.4 (Turbopack)
- Local:         http://localhost:3000

✓ Ready in 548ms
GET /some-page 200 in 3.0s
# POST /api/test never appears

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: macOS
Node: 24.8.0
pnpm: (run pnpm -v to get version)
Relevant Packages:
  next: 16.1.4
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.x

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

Turbopack

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

next dev (local)

Additional context

GET requests to API routes work fine POST requests to the same route work intermittently when the server first starts, before Turbopack fully initializes Middleware is configured to exclude /api routes:

export const config = {
  matcher: ["/((?!api|_next/static|_next/image|favicon.ico|login).*)"],
};

Workarounds attempted:

  • TURBOPACK=0 next dev - Still uses Turbopack in Next.js 16
  • Using absolute URL ${window.location.origin}/api/test - Still doesn't reach server
  • rm -rf .next - No effect
  • Downgrading to Next.js 15.1.3 - Resolves the issue

This appears to be a critical routing bug in Turbopack that prevents POST requests from client components from reaching API route handlers.

extent analysis

TL;DR

Downgrade to Next.js 15.1.3 to resolve the issue with POST requests not reaching API route handlers in Turbopack.

Guidance

  • The issue seems to be related to Turbopack in Next.js 16.1.4, as downgrading to Next.js 15.1.3 resolves the problem.
  • Verify that the issue is indeed caused by Turbopack by checking if GET requests to API routes work fine, as mentioned in the additional context.
  • Attempt to use a different version of Next.js, such as the latest version, to see if the issue has been fixed.
  • If downgrading is not feasible, consider using a workaround, such as making the request from a non-client component or using a different routing mechanism.

Example

No code snippet is provided as the issue seems to be related to the configuration and version of Next.js rather than a specific code snippet.

Notes

The issue appears to be specific to Turbopack in Next.js 16.1.4, and downgrading to Next.js 15.1.3 resolves the issue. However, this may not be a feasible solution for all users, and further investigation may be needed to find a workaround or fix for the issue in Next.js 16.1.4.

Recommendation

Apply workaround: Downgrade to Next.js 15.1.3, as this has been confirmed to resolve the issue. This is a temporary solution until a fix is available for Next.js 16.1.4.

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