nextjs - 💡(How to fix) Fix Next.js 16.2.x build crash (SIGTRAP) with Pages Router + i18n + next/font + standalone

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…

Root Cause

  • next build (Turbopack default) → SIGTRAP
  • next build --webpack → SIGTRAP
  • .babelrc with next/babel preset → SWC disabled but fails because next/font requires SWC
  • NODE_OPTIONS="--max-old-space-size=8192" → same crash
  • NEXT_DEBUG_BUILD=1 → no additional debug output
  • Clean install (rm -rf node_modules .next && npm install) → same crash
  • Node.js 20.13.1 and 22.x → same crash on both
  • Next.js 16.2.5 and 16.2.6 → same crash on both
  • macOS ARM64 (Apple Silicon) and Linux (GCP Cloud Build) → same crash on both platforms

Fix Action

Fix / Workaround

  • SWC native binary (@next/swc-darwin-arm64) is correctly installed and matches the platform
  • The crash happens in the SWC compilation phase (after TypeScript check, during "optimized production build")
  • Since --webpack flag only changes the bundler but still uses SWC for transpilation, the crash persists
  • This is a security-critical blocker: 16.2.5+ contains patches for 12 CVEs (middleware bypass, SSRF, XSS, DoS) per https://developers.cloudflare.com/changelog/post/2026-05-06-react-nextjs-vulnerabilities/

Code Example

Next.js 16.2.6 (webpack)
The "middleware" file convention is deprecated. Please use "proxy" instead.
 Finished TypeScript in 16.1s
  Creating an optimized production build ...
Next.js build worker exited with code: null and signal: SIGTRAP
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

Private repo (bhaptics.com). Reproduction steps below.

To Reproduce

  1. Next.js project with Pages Router
  2. Configuration:
    • i18n with 7 locales (en, ko, ja, zh, es, fr, de)
    • output: "standalone"
    • trailingSlash: true
    • next/font (Noto Sans) imported in _app.tsx
    • middleware.ts with locale redirect logic
    • ~350 pages
  3. Upgrade from Next.js 16.1.7 to 16.2.5 or 16.2.6
  4. Run next build (Turbopack) or next build --webpack

Current vs. Expected behavior

Current: Build crashes immediately after "Creating an optimized production build..."

▲ Next.js 16.2.6 (webpack)
⚠ The "middleware" file convention is deprecated. Please use "proxy" instead.
✓ Finished TypeScript in 16.1s
  Creating an optimized production build ...
Next.js build worker exited with code: null and signal: SIGTRAP

Expected: Build completes successfully (works fine on 16.1.7).

What I've tried

  • next build (Turbopack default) → SIGTRAP
  • next build --webpack → SIGTRAP
  • .babelrc with next/babel preset → SWC disabled but fails because next/font requires SWC
  • NODE_OPTIONS="--max-old-space-size=8192" → same crash
  • NEXT_DEBUG_BUILD=1 → no additional debug output
  • Clean install (rm -rf node_modules .next && npm install) → same crash
  • Node.js 20.13.1 and 22.x → same crash on both
  • Next.js 16.2.5 and 16.2.6 → same crash on both
  • macOS ARM64 (Apple Silicon) and Linux (GCP Cloud Build) → same crash on both platforms

Environment

  • Next.js: 16.2.5 / 16.2.6 (works on 16.1.7)
  • React: 19.2.6
  • Node.js: 20.13.1 / 22.x
  • OS: macOS ARM64 (M-series) + Linux x64 (GCP)
  • Package manager: npm
  • Pages Router with next-i18next

Which area(s) are affected?

SWC, Build (next build), Pages Router

Additional context

  • SWC native binary (@next/swc-darwin-arm64) is correctly installed and matches the platform
  • The crash happens in the SWC compilation phase (after TypeScript check, during "optimized production build")
  • Since --webpack flag only changes the bundler but still uses SWC for transpilation, the crash persists
  • This is a security-critical blocker: 16.2.5+ contains patches for 12 CVEs (middleware bypass, SSRF, XSS, DoS) per https://developers.cloudflare.com/changelog/post/2026-05-06-react-nextjs-vulnerabilities/

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 Next.js 16.2.x build crash (SIGTRAP) with Pages Router + i18n + next/font + standalone