nextjs - 💡(How to fix) Fix Turbopack Build Fails When Using Sanity CMS [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#84294Fetched 2026-04-08 02:20:02
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1issue_type_added ×1

Error Message

next build --turbopack

▲ Next.js 15.5.4 (Turbopack)

  • Environments: .env.local

Creating an optimized production build ...

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13: The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13: The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546 ✓ Finished writing to disk in 55ms

Build error occurred [Error: Turbopack build failed with 2 errors: ./node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs Code generation for chunk item errored An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>

Caused by:

  • The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601

Debug info:

  • An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>
  • Execution of *EcmascriptChunkItemContent::module_factory failed
  • Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
  • Execution of *EcmascriptChunkItemContent::new failed
  • Execution of EcmascriptModuleContent::new_merged failed
  • The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601

./node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs Code generation for chunk item errored An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>

Caused by:

  • The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

Debug info:

  • An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>
  • Execution of *EcmascriptChunkItemContent::module_factory failed
  • Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
  • Execution of *EcmascriptChunkItemContent::new failed
  • Execution of EcmascriptModuleContent::new_merged failed
  • The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

]  ELIFECYCLE  Command failed with exit code 1.

Root Cause

Caused by:

  • The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601

Code Example

> next build --turbopack

Next.js 15.5.4 (Turbopack)
   - Environments: .env.local

   Creating an optimized production build ...

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13:
The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13:
The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546
Finished writing to disk in 55ms

> Build error occurred
[Error: Turbopack build failed with 2 errors:
./node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>

Caused by:
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601

Debug info:
- An error occurred while generating the chunk item [project]/node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
- Execution of *EcmascriptChunkItemContent::new failed
- Execution of EcmascriptModuleContent::new_merged failed
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601


./node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>

Caused by:
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

Debug info:
- An error occurred while generating the chunk item [project]/node_modules/.pnpm/sanity@4.10.1_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
- Execution of *EcmascriptChunkItemContent::new failed
- Execution of EcmascriptModuleContent::new_merged failed
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

]
ELIFECYCLECommand failed with exit code 1.

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32568
  Available CPU cores: 20
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

---

Operating System:
  Platform: linux
  Arch: x64
  Version: #18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025
  Available memory (MB): 15996
  Available CPU cores: 4
Binaries:
  Node: 22.19.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/john-james-gh/blog

To Reproduce

  1. Generate a fresh Next.js app.
  2. Generate a fresh Sanity CMS app within the same directory using pnpm create sanity@latest as described here https://www.sanity.io/docs/next-js-quickstart/setting-up-your-studio
  3. Run pnpm build, which runs next build --turbopack

Current vs. Expected behavior

next build works fine but next build --turbopack throws the error below:

> next build --turbopack

   ▲ Next.js 15.5.4 (Turbopack)
   - Environments: .env.local

   Creating an optimized production build ...

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13:
The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'tokio-runtime-worker' panicked at turbopack\crates\turbopack-ecmascript\src\lib.rs:2429:13:
The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546
 ✓ Finished writing to disk in 55ms

> Build error occurred
[Error: Turbopack build failed with 2 errors:
./node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>

Caused by:
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601

Debug info:
- An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-client] (ecmascript) <locals>
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
- Execution of *EcmascriptChunkItemContent::new failed
- Execution of EcmascriptModuleContent::new_merged failed
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=601


./node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>

Caused by:
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

Debug info:
- An error occurred while generating the chunk item [project]/node_modules/.pnpm/[email protected]_@emotion+is-p_b145ba7fae607919b1a73627c10e5b0e/node_modules/sanity/lib/index.mjs [app-ssr] (ecmascript) <locals>
- Execution of *EcmascriptChunkItemContent::module_factory failed
- Execution of <MergedEcmascriptModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
- Execution of *EcmascriptChunkItemContent::new failed
- Execution of EcmascriptModuleContent::new_merged failed
- The high bits of the position 4218194 are not all 0s or 1s. modules_header_width=10, module=546

]
 ELIFECYCLE  Command failed with exit code 1.

Provide environment information

Local

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32568
  Available CPU cores: 20
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

CI (GitHub Actions)

Operating System:
  Platform: linux
  Arch: x64
  Version: #18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025
  Available memory (MB): 15996
  Available CPU cores: 4
Binaries:
  Node: 22.19.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.4
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

Turbopack

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

next build (local)

Additional context

Also throws in GitHub Actions (ubuntu-latest) with the same error.

extent analysis

TL;DR

The issue is likely related to a compatibility problem between Next.js 15.5.4 and the Turbopack build process, specifically with the Sanity CMS module, and can be mitigated by adjusting the build configuration or updating dependencies.

Guidance

  1. Check for updates: Ensure all dependencies, including Next.js and Sanity CMS, are up-to-date, as newer versions may resolve compatibility issues.
  2. Adjust Turbopack configuration: Investigate if there are any configuration options for Turbopack that can help mitigate the issue, such as adjusting the modules_header_width.
  3. Disable Turbopack for build: Temporarily disable Turbopack for the build process to see if the issue persists, by running next build without the --turbopack flag.
  4. Test with different Node versions: Given the difference in Node versions between local and CI environments, test the build process with the same Node version used in the CI environment (Node 22.19.0) to isolate if the issue is Node version-specific.

Example

No specific code example is provided as the issue seems to be related to configuration and compatibility rather than a code snippet.

Notes

The solution may depend on the specific versions of Next.js, Turbopack, and Sanity CMS used. The issue appears in both local and CI environments, suggesting a deeper compatibility issue rather than an environment-specific problem.

Recommendation

Apply a workaround by disabling Turbopack for the build process or adjusting its configuration, as updating to a fixed version is not explicitly implied in the given information. This approach allows for temporary mitigation of the issue while awaiting further updates or fixes from the dependencies involved.

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