Skip to content

@sentry/cloudflare not reporting errors thrown from Durable Objects #16786

Description

@jczstudios

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/cloudflare

SDK Version

9.34.0

Framework Version

9.34.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

import{DurableObject}from"cloudflare:workers";import*asSentryfrom"@sentry/cloudflare";classMyDurableObjectBaseextendsDurableObject<Env>{constructor(ctx: DurableObjectState,env: Env){super(ctx,env);}asyncsayHello(name: string): Promise<string>{thrownewError("Should be recorded in Sentry.")}}exportconstMyDurableObject=Sentry.instrumentDurableObjectWithSentry((env: Env)=>({dsn: "__YOUR_DSN__",tracesSampleRate: 1.0,debug: true}),MyDurableObjectBase,);exportdefault{asyncfetch(request,env,ctx): Promise<Response>{constid: DurableObjectId=env.MY_DURABLE_OBJECT.idFromName("foo");conststub=env.MY_DURABLE_OBJECT.get(id);constgreeting=awaitstub.sayHello("world");returnnewResponse(greeting);},}satisfiesExportedHandler<Env>;

Steps to Reproduce

  1. Send fetch request to a worker instrumented with Sentry.instrumentDurableObjectWithSentry where the Durable Object RPC method throws when called by the worker. (see example above)
  2. No Sentry logs (console) / errors are recorded.

Expected Result

Sentry should record errors thrown according to the docs

Additionally, since debug: true is set, there should be debug logs from the Sentry library.

Actual Result

Image

No debug logs visible, no errors reported to Sentry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions