nextjs - 💡(How to fix) Fix Dev server silently exits (code 0) with cacheComponents + Turbopack on Node 24 [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#91798Fetched 2026-04-08 01:16:14
View on GitHub
Comments
3
Participants
3
Timeline
7
Reactions
0
Author
Assignees
Timeline (top)
commented ×3subscribed ×2assigned ×1labeled ×1

Error Message

Current: Dev server starts, prints "Ready in ~200ms", then the process exits cleanly (exit code 0). No error message, no stack trace.

Fix Action

Fix / Workaround

Workaround: Use next dev --webpack instead of Turbopack when cacheComponents is enabled.

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin 25.3.0
  Available memory (MB): 36864
  Available CPU cores: 12
Binaries:
  Node: 24.11.0
  npm: 11.4.1
  Yarn: 4.12.0
  pnpm: N/A
Relevant Packages:
  next: 16.2.0
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.0

---

// next.config.mjs
const nextConfig = {
  cacheComponents: true,
};

export default nextConfig;
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/styled-components/styled-components-website

To Reproduce

  1. Use Next.js 16.2.0 with Node.js 24.11.0
  2. Enable cacheComponents: true in next.config.mjs
  3. Run next dev (Turbopack is the default)
  4. Server prints "Ready" then immediately exits with code 0

Current vs. Expected behavior

Current: Dev server starts, prints "Ready in ~200ms", then the process exits cleanly (exit code 0). No error message, no stack trace.

Expected: Dev server stays running and serves requests.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin 25.3.0
  Available memory (MB): 36864
  Available CPU cores: 12
Binaries:
  Node: 24.11.0
  npm: 11.4.1
  Yarn: 4.12.0
  pnpm: N/A
Relevant Packages:
  next: 16.2.0
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.0

Debugging details

  • NODE_DEBUG=net shows connections being torn down immediately after startup
  • Exit code is 0 (clean exit, not a crash)
  • The build (next build) works fine with cacheComponents: true
  • next dev --webpack with cacheComponents: true works fine (server stays alive)
  • next dev (Turbopack) without cacheComponents works fine
  • The combination of Turbopack + cacheComponents causes the silent exit

Minimal config to reproduce

// next.config.mjs
const nextConfig = {
  cacheComponents: true,
};

export default nextConfig;

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

Developer Experience, Turbopack

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

next dev (local)

Additional context

Workaround: Use next dev --webpack instead of Turbopack when cacheComponents is enabled.

extent analysis

Fix Plan

To resolve the issue with Next.js 16.2.0 and Turbopack, where the dev server exits immediately after startup when cacheComponents is enabled, follow these steps:

  • Disable Turbopack: Run next dev with the --webpack flag to use the traditional Webpack bundler instead of Turbopack.
  • Update Next.js configuration: Alternatively, you can disable cacheComponents in your next.config.mjs file:
// next.config.mjs
const nextConfig = {
  // cacheComponents: true, // Comment out or set to false
};

export default nextConfig;
  • Wait for a fix: If you prefer to use Turbopack, monitor the Next.js and styled-components issue trackers for updates on this specific problem.

Verification

To verify that the fix worked:

  1. Run next dev --webpack (if using the Webpack workaround).
  2. Access your development server in a web browser to ensure it stays running and serves requests.
  3. Check the terminal output for the "Ready" message without an immediate exit.

Extra Tips

  • Keep your dependencies up-to-date, as fixes for such issues are often included in newer versions of Next.js, React, and other relevant packages.
  • Consider contributing to or following the relevant issue trackers for Next.js and styled-components to stay informed about fixes and workarounds for similar problems.

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