You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@sentry/cloudflare not reporting errors thrown from Durable Objects #16786
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
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)
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
No debug logs visible, no errors reported to Sentry.
I have the exact same issue except with Cloudflare Workers, traces are working fine, but my thrown errors aren't appearing in issues. Set it up just now using the Configure Cloudflare Workers SDK docs on a new Cloudflare Workers project.
Note: Calling Sentry.captureException works as expected.
On the new version, we are now getting the error: The RPC receiver does not implement the method "METHOD_NAME". This appears locally and in production. See: cloudflare/workerd#4499
Activity
andreiborza commentedon Jul 2, 2025
Hi @jczstudios, thanks for filing this. We'll take a look.
cc @AbhiPrasad
AbhiPrasad commentedon Jul 2, 2025
I'm going to pass this off to @timfish given he's been touching cloudflare stuff recently and I don't have time to follow up - could you take a look?
jasperdunn commentedon Jul 5, 2025
I have the exact same issue except with Cloudflare Workers, traces are working fine, but my thrown errors aren't appearing in issues. Set it up just now using the Configure Cloudflare Workers SDK docs on a new Cloudflare Workers project.
Note: Calling
Sentry.captureExceptionworks as expected.fix(cloudflare): Ensure errors get captured from durable objects (get…
github-actions commentedon Jul 17, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #16838, which was included in the 9.40.0 release.
jczstudios commentedon Jul 21, 2025
On the new version, we are now getting the error:
The RPC receiver does not implement the method "METHOD_NAME".This appears locally and in production. See: cloudflare/workerd#4499