nextjs - ✅(Solved) Fix Every 5minutes I hit by 400 bad request in version 15 and 16 with turbopack only [1 pull requests, 1 comments, 1 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#86718Fetched 2026-04-08 02:09:36
View on GitHub
Comments
1
Participants
1
Timeline
9
Reactions
5
Author
Participants
Timeline (top)
subscribed ×3commented ×1cross-referenced ×1issue_type_added ×1

Error Message

error message on the browser's console: I noticed that when I use turbopack for dev script the error keeps happening in 5min as an average, especially when I remove or write code, and I try to reload the page the browser keeps sending the same error but the terminal shows 200 response, so I rerun the dev script again to make it work.

Fix Action

Fixed

PR fix notes

PR #86729: Fix dev server 400 errors after 5 minutes with Turbopack

Description (problem / solution / changelog)

Fixes #86718

Disables HTTP request/headers timeouts in dev mode to prevent 400 Bad Request errors after 5 minutes of idle connection time. Affects HMR WebSocket connections and long-running Turbopack compilation tasks.

Node.js defaults: requestTimeout=300000ms (5 min), headersTimeout=60000ms. Setting to 0 disables timeouts in development only.

Changed files

  • packages/next/src/server/lib/start-server.ts (modified, +8/-0)

Code Example

GET
http://localhost:3000/dashboard/properties/create
net::ERR_HTTP_RESPONSE_CODE_FAILURE 400 (Bad Request)

---

"scripts": {
    "dev": "next dev --turbopack",
    "dev:no-turbopack": "next dev",
    "build": "next build --turbopack",
    "start": "next start"
  },

---

/bin/sh: yarn: command not found

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:56 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8132
  Available memory (MB): 24576
  Available CPU cores: 10
Binaries:
  Node: 24.9.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.15.1
Relevant Packages:
  next: 15.5.2 // An outdated version detected (latest is 16.0.6), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A
An outdated version detected (latest is 16.0.6), upgrade is highly recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/sfwnisme/frontend-real-estate

To Reproduce

error message on the browser's console:

GET
http://localhost:3000/dashboard/properties/create
net::ERR_HTTP_RESPONSE_CODE_FAILURE 400 (Bad Request)

I noticed that when I use turbopack for dev script the error keeps happening in 5min as an average, especially when I remove or write code, and I try to reload the page the browser keeps sending the same error but the terminal shows 200 response, so I rerun the dev script again to make it work. When I use dev script without turbopack the problem disappears.

package.json

  "scripts": {
    "dev": "next dev --turbopack",
    "dev:no-turbopack": "next dev",
    "build": "next build --turbopack",
    "start": "next start"
  },

this issue happens to me for the both versions app router 15 and 16, and not for a specific route, but for any one.

Current vs. Expected behavior

<img width="793" height="278" alt="Image" src="https://github.com/user-attachments/assets/dabc497f-be04-4e4f-872c-af2c71218b15" />

Provide environment information

/bin/sh: yarn: command not found

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:56 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8132
  Available memory (MB): 24576
  Available CPU cores: 10
Binaries:
  Node: 24.9.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.15.1
Relevant Packages:
  next: 15.5.2 // An outdated version detected (latest is 16.0.6), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A
 ⚠ An outdated version detected (latest is 16.0.6), upgrade is highly recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

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

Turbopack

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

next dev (local)

Additional context

No response

extent analysis

TL;DR

  • Try running next dev without Turbopack or upgrade Next.js to the latest version to potentially resolve the 400 Bad Request error.

Guidance

  • Verify that the issue is indeed related to Turbopack by consistently reproducing the error with next dev --turbopack and confirming it disappears with next dev.
  • Check the browser's console and terminal output for any other error messages that might indicate the root cause of the 400 Bad Request error.
  • Consider upgrading Next.js to the latest version (16.0.6) as recommended, to ensure you have the latest fixes and improvements.
  • If the issue persists after upgrading, try installing the latest canary version of Next.js (npm install next@canary) to confirm if the issue still exists.

Example

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

Notes

  • The provided environment information indicates an outdated version of Next.js, which might be contributing to the issue.
  • The fact that the error disappears when running next dev without Turbopack suggests that Turbopack could be the culprit, but upgrading Next.js might also resolve the issue.

Recommendation

  • Upgrade to the latest version of Next.js (16.0.6) as it is highly recommended and might fix the issue, especially since the current version (15.5.2) is outdated.

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