Skip to content

Failed to load external module with turbopack #25370

@Haaxor1689

Description

@Haaxor1689

What version of Bun is running?

1.3.3

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What steps can reproduce the bug?

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

  1. bun i
  2. bun --bun dev (--bun is important to run with bun runtime)
  3. Open http://localhost:3000

What is the expected behavior?

Should load the module successfully

What do you see instead?

⨯ Error: 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'
    at module evaluation (file:\C:\Projects\reproduction-app\app\page.tsx:1:1)
    at module evaluation (C:\Projects\reproduction-app\.next\dev\server\chunks\ssr\[root-of-the-server]__1222724e._.js:39:47)
    at map (null)
    at processTicksAndRejections (null)
> 1 | import { S3 } from '@aws-sdk/client-s3';

Additional information

This issue was initially opened as a nextjs issue and was marked as fixed by this PR. It fixed the issue for node runtime but did not solve it for bun runtime. NextJs maintainer suggested to make this PR here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions