nextjs - 💡(How to fix) Fix Failed to load external module with turbopack and bun [19 comments, 11 participants]

Official PRs (…)
ON THIS PAGE

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#86866Fetched 2026-04-08 02:08:49
View on GitHub
Comments
19
Participants
11
Timeline
73
Reactions
7
Timeline (top)
subscribed ×32commented ×19mentioned ×13referenced ×3

Error Message

You get following error when importing anything from "@aws-sdk/client-s3".

Code Example

Failed to load external module @aws-sdk/client-s3-ecbef8e33fd0b8f0: ResolveMessage: Cannot find module '@aws-sdk/client-s3-ecbef8e33fd0b8f0' from 'C:\Projects\reproduction-app\.next\dev\server\chunks\ssr\[root-of-the-server]__8c5801f7._.js'

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65451
  Available CPU cores: 16
Binaries:
  Node: 23.10.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.7.0
Relevant Packages:
  next: 16.1.0-canary.14 // Latest available version is detected (16.1.0-canary.14).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Haaxor1689/next-turbopack-issue-repro

To Reproduce

  1. bun i
  2. bun --bun dev (--bun is important to run with bun runtime)

Current vs. Expected behavior

You get following error when importing anything from "@aws-sdk/client-s3".

Failed to load external module @aws-sdk/client-s3-ecbef8e33fd0b8f0: ResolveMessage: Cannot find module '@aws-sdk/client-s3-ecbef8e33fd0b8f0' from 'C:\Projects\reproduction-app\.next\dev\server\chunks\ssr\[root-of-the-server]__8c5801f7._.js'

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65451
  Available CPU cores: 16
Binaries:
  Node: 23.10.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.7.0
Relevant Packages:
  next: 16.1.0-canary.14 // Latest available version is detected (16.1.0-canary.14).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
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 dev (local)

Additional context

Since Bun is not in next info - I'm using Bun v1.3.2 This issue was already reported once by me and closed as fixed here #86652. This solved the issue in 16.1.0-canary.10 for node runtime but the issue in bun runtime still persists.

extent analysis

TL;DR

The issue with importing modules from "@aws-sdk/client-s3" in a Next.js project using the Bun runtime may be related to Turbopack and can potentially be mitigated by adjusting the configuration or waiting for a fix in a future version.

Guidance

  • Verify that the issue is indeed related to the interaction between Next.js, Turbopack, and the Bun runtime by trying to import other modules and seeing if the issue persists.
  • Check if there are any open issues or discussions on the Next.js or Bun repositories that may provide more insight into this problem or offer temporary workarounds.
  • Consider testing the application with a different runtime (like Node) to isolate if the issue is specific to the Bun runtime.
  • Review the configuration files (e.g., next.config.js) for any settings that might be affecting how modules are resolved or loaded in the development environment.

Notes

The provided information suggests that this issue has been encountered before and was supposedly fixed in a previous version for the Node runtime, but it persists when using the Bun runtime. This indicates that the problem might be specific to how Turbopack interacts with the Bun runtime.

Recommendation

Apply workaround: Given the history of this issue and its persistence across different runtimes, applying a workaround (if found) or waiting for a future version that addresses this specific interaction between Next.js, Turbopack, and the Bun runtime might be the most viable option.

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 Failed to load external module with turbopack and bun [19 comments, 11 participants]