nextjs - 💡(How to fix) Fix Turbopack panic: index out of bounds in tree_shake/graph.rs:743 when experimental.turbopackTreeShaking is enabled (next build, 16.2.4) [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#93424Fetched 2026-05-03 04:37:49
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
issue_type_added ×1labeled ×1

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32648
  Available CPU cores: 12
Binaries:
  Node: 25.4.0
  npm: 11.7.0
  Yarn: N/A
  pnpm: 10.28.2
Relevant Packages:
  next: 16.1.6 // There is a newer version (16.2.4) available, upgrade recommended! 
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/AbdQaddora/next-turbopack-tree-shaking-true-issue

To Reproduce

``

Current vs. Expected behavior

  1. Clone the linked reproduction repository.
  2. Open next.config.ts and confirm experimental.turbopackTreeShaking: true is set (already enabled in the repro). This is the trigger — without it, the build completes successfully.
  3. Run pnpm install.
  4. Run pnpm run build.
  5. The build aborts with a Rust panic in turbopack-ecmascript:

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32648
  Available CPU cores: 12
Binaries:
  Node: 25.4.0
  npm: 11.7.0
  Yarn: N/A
  pnpm: 10.28.2
Relevant Packages:
  next: 16.1.6 // There is a newer version (16.2.4) available, upgrade recommended! 
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3

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

Turbopack

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

next build (local)

Additional context

  • This is a build-time crash in Turbopack itself, not a runtime/deployment issue. It happens locally (Windows 11 x64) before any deploy target is reached.

extent analysis

TL;DR

Upgrade to the latest version of Next.js, as a newer version (16.2.4) is available, which may include fixes for the Turbopack issue.

Guidance

  • Verify that the issue is indeed caused by the experimental.turbopackTreeShaking: true setting by temporarily disabling it and checking if the build completes successfully.
  • Check the changelog of Next.js to see if any fixes related to Turbopack or tree shaking were included in versions newer than 16.1.6.
  • Consider testing the build process on a different platform or environment to rule out any platform-specific issues.
  • If upgrading Next.js is not feasible, try to identify any specific dependencies or configurations that might be contributing to the issue.

Notes

The provided information suggests that the issue is related to Turbopack and the experimental.turbopackTreeShaking setting, but without more details about the Rust panic error, it's difficult to provide a more specific solution.

Recommendation

Upgrade to the latest version of Next.js (16.2.4), as it may include fixes for the Turbopack issue, and the current version (16.1.6) has a known issue that is triggered by the experimental.turbopackTreeShaking: true setting.

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 Turbopack panic: index out of bounds in tree_shake/graph.rs:743 when experimental.turbopackTreeShaking is enabled (next build, 16.2.4) [1 participants]