nextjs - 💡(How to fix) Fix Turbopack build fails in Bun v1.3.5: Expected CommonJS module to have a function wrapper [1 comments, 2 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#87417Fetched 2026-04-08 02:07:05
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Error Message

The build fails during the static generation phase while 3 workers are collecting page data. It throws a TypeError: Expected CommonJS module to have a function wrapper. This error originates from Bun's internal transpiler while trying to load a Turbopack-generated SSR chunk (e.g., server/chunks/ssr/cbe5c294..js). Error Log Snippet: Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/_not-found/page.js The issue seems specifically related to how Bun 1.3.5 handles the CommonJS wrapper for SSR chunks generated by Turbopack in Next.js 16. The error message explicitly mentions: "If you weren't messing around with Bun's internals, this is a bug in Bun", but it is triggered by the Next.js/Turbopack build output. This happens across multiple routes including _not-found, about-us, and dashboard. Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/_not-found/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/about-us/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/active-cooperation/detail/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/active-cooperation/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/dashboard/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/event/detail/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/event/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/faq/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/how-to-participate/detail/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/forgot-password/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/how-to-participate/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/course/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/certificate/page.js Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/knowledge/page.js

Build error occurred Error: Failed to collect page data for /_not-found type: 'Error' error: script "build" exited with code 1 ERROR: Job failed: exit code 1

Code Example

Operating System:
  Platform: Ubuntu 24.04
  Arch: x64
Binaries:
  Node: 20
  Bun: 1.3.5
Relevant Packages:
  next: 16.0.10
  react: 19.0.0
  react-dom: 19.0.0
  effect: 3.19.13
  @effect/schema: 0.75.5
  daisyui: 4.12.24
Next.js Config:
  output: N/A
  experimental: { turbopack: true }
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://cdn.artifacts.gitlab-static.net/f9/9b/f99bd9078c7982fe55c581d428c4f9253ae2cc6901dfc32e0e762e3e4148d4a4/2025_12_19/12498548067/14273583413/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&Expires=1766161247&KeyName=gprd-artifacts-cdn&Signature=ZW5KC1cEFPy_-8kjKS6tm4njzV0=

To Reproduce

  1. Use Bun v1.3.5 as the package manager and runtime.
  2. Initialize a Next.js 16.0.10 project with appRouter and Turbopack enabled.
  3. Install the following dependencies: [email protected], @effect/[email protected], and [email protected].
  4. Run the production build command: bun run build.
  5. Observe the crash during the "Collecting page data" phase.

Current vs. Expected behavior

Current Behavior: The build fails during the static generation phase while 3 workers are collecting page data. It throws a TypeError: Expected CommonJS module to have a function wrapper. This error originates from Bun's internal transpiler while trying to load a Turbopack-generated SSR chunk (e.g., server/chunks/ssr/cbe5c294..js).

Error Log Snippet: Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/_not-found/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun

Expected Behavior: The build should successfully complete the "Collecting page data" phase and generate the production build without runtime errors, even when using Turbopack with Bun.

Provide environment information

Operating System:
  Platform: Ubuntu 24.04
  Arch: x64
Binaries:
  Node: 20
  Bun: 1.3.5
Relevant Packages:
  next: 16.0.10
  react: 19.0.0
  react-dom: 19.0.0
  effect: 3.19.13
  @effect/schema: 0.75.5
  daisyui: 4.12.24
Next.js Config:
  output: N/A
  experimental: { turbopack: true }

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

Turbopack

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

next build (local)

Additional context

The issue seems specifically related to how Bun 1.3.5 handles the CommonJS wrapper for SSR chunks generated by Turbopack in Next.js 16. The error message explicitly mentions: "If you weren't messing around with Bun's internals, this is a bug in Bun", but it is triggered by the Next.js/Turbopack build output. This happens across multiple routes including _not-found, about-us, and dashboard.

Ful Log: $ bun install bun install v1.3.5 (1e86cebd)

  • @effect/[email protected]
  • [email protected] 8 packages installed [287.00ms] $ bun run build $ next build ▲ Next.js 16.0.10 (Turbopack)
    • Experiments (use with caution): · serverActions Creating an optimized production build ... 🌼 daisyUI 4.12.24 ├─ ✔︎ 2 themes added https://daisyui.com/docs/themes ╰─ ★ Star daisyUI on GitHub https://github.com/saadeghi/daisyui ✓ Compiled successfully in 7.7s Running TypeScript ... Collecting page data using 3 workers ... Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/_not-found/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/_not-found/page.js:13:3) at anonymous (null) at processTicksAndRejections (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/_not-found/page.js:13:3) at anonymous (null) at processTicksAndRejections (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/about-us/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/about-us/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/about-us/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/active-cooperation/detail/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/active-cooperation/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/active-cooperation/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/active-cooperation/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/active-cooperation/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/active-cooperation/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/dashboard/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/dashboard/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/dashboard/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/event/detail/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/event/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/event/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/event/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/event/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/event/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/faq/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/faq/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/faq/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/how-to-participate/detail/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/how-to-participate/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/how-to-participate/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/forgot-password/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/forgot-password/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/forgot-password/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/cooperation/how-to-participate/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/how-to-participate/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/cooperation/how-to-participate/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/course/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/course/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/course/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/learning/detail/certificate/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/certificate/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/learning/detail/certificate/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) } Error: Failed to load chunk server/chunks/ssr/cbe5c294..js from runtime for chunk server/app/functions/knowledge/page.js at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:636:19) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/knowledge/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) { [cause]: TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun at anonymous (null) at loadRuntimeChunkPath (.next/server/chunks/ssr/[turbopack]_runtime.js:628:30) at loadRuntimeChunk (.next/server/chunks/ssr/[turbopack]_runtime.js:605:9) at c (.next/server/chunks/ssr/[turbopack]_runtime.js:766:25) at <anonymous> (.next/server/app/functions/knowledge/page.js:15:3) at anonymous (null) at processTicksAndRejections (null) }

Build error occurred Error: Failed to collect page data for /_not-found at processTicksAndRejections (null) at processTicksAndRejections (null) { type: 'Error' } error: script "build" exited with code 1 Cleaning up project directory and file based variables 00:00 ERROR: Job failed: exit code 1

extent analysis

TL;DR

The most likely fix is to update or adjust the configuration of Bun or Next.js to ensure compatibility with Turbopack, as the error suggests a bug in how Bun handles CommonJS modules generated by Turbopack.

Guidance

  1. Check Bun Version: Ensure you are using the latest version of Bun, as updates may have resolved the issue with handling CommonJS modules.
  2. Turbopack Configuration: Review the Turbopack configuration in your Next.js project to ensure it is set up correctly and compatible with Bun.
  3. Next.js Configuration: Verify that your Next.js configuration, especially the parts related to server components and Turbopack, is correctly set up and compatible with Bun v1.3.5.
  4. Disable Turbopack: Temporarily disable Turbopack to see if the issue persists, which can help determine if the problem is specifically related to Turbopack and Bun interaction.
  5. Check for Updates: Ensure all dependencies, including Next.js, React, and related packages, are up to date, as newer versions may include fixes for compatibility issues.

Example

No specific code example is provided due to the nature of the issue, which seems to be related to the interaction between Bun, Next.js, and Turbopack. However, reviewing the next.config.js file for Turbopack settings and ensuring that Bun is configured to work with Next.js server components could be a starting point.

Notes

  • The error message suggests a potential bug in Bun's handling of CommonJS modules, specifically those generated by Turbopack.
  • Compatibility issues between different versions of development tools and frameworks can often be resolved by updating to the latest versions or adjusting configurations.

Recommendation

Apply a workaround by adjusting the Next.js or Turbopack configuration to mitigate the compatibility issue with Bun v1.3.5, as updating Bun or waiting for a fix might not be immediately feasible.

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