Skip to content

@sentry/bun fails with SyntaxError: Missing 'default' export in module #17715

@Gorthog

Description

@Gorthog

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

10.12.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

Running this code with bun:

import Sentry from "@sentry/bun";

Sentry.init();

Expected Result

Code runs without an issue

Actual Result

I get this error:
1 | (function (entry, fetcher)
^
SyntaxError: Missing 'default' export in module '/home/user/projects/bun-sentry/node_modules/@sentry/bun/build/esm/index.js'.
at loadAndEvaluateModule (1:11)
at link (1:11)
at link (1:11)
at linkAndEvaluateModule (1:11)
at loadAndEvaluateModule (2:1)
at processTicksAndRejections (7:39)

Bun v1.2.22 (Linux x64)

Additional Context

Trying to integrate Sentry with bun. I had a much larger instrumentation file but I whittled it down to this root cause.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions