Skip to content

[@sentry/bun] Recent update breaks bun integration #15827

Closed
@ShaneIsrael

Description

@ShaneIsrael

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/bun

SDK Version

8.50.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Use bun as your nodejs server
  2. Setup sentry

Expected Result

The application stands up without issue and sentry initializes correctly.

Actual Result

The application crashes with a TypeError error.

[2025-03-25 18:00:50] [Sentry] express is not instrumented. This is likely because you required/imported express before calling `Sentry.init()`.
[2025-03-25 18:00:50] 40 | 
[2025-03-25 18:00:50] 41 | /**
[2025-03-25 18:00:50] 42 |  * Instruments Bun.serve `fetch` option to automatically create spans and capture errors.
[2025-03-25 18:00:50] 43 |  */
[2025-03-25 18:00:50] 44 | function instrumentBunServeOptions(serveOptions) {
[2025-03-25 18:00:50] 45 |   serveOptions.fetch = new Proxy(serveOptions.fetch, {
[2025-03-25 18:00:50]                                 ^
[2025-03-25 18:00:50] TypeError: A Proxy's 'target' should be an Object
[2025-03-25 18:00:50]       at Proxy (/app/node_modules/@sentry/bun/build/esm/integrations/bunserver.js:45:28)
[2025

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: bunIssues related to the Sentry Bun SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions