Service Binding for DO does not show up in env
I have a worker (
WorkerA
) that implements a Durable Object (DOA
). This is working fine. I can access env.DOA
and call functions on the Durable Object just fine.
I have a second worker (WorkerB
) that declares DOA
as a service binding to WorkerA
. When I call env.DOA
in this second worker, I get an object with type Fetcher
rather than DurableObjectNamespace
.
Is this expected? Has anyone else run into this? Am I holding this wrong?5 Replies
In
WorkerA
's wrangler.toml
, I have:
in WorkerB
's wrangler.toml
, I have:
This seems like it's only for HTTP binding? Do I need to do something else to have an RPC binding?Oh, maybe this is not yet supported? https://github.com/cloudflare/workers-sdk/issues/5918
GitHub
🚀 Feature Request:RPC Support for Durable Objects in
wrangler dev
...Describe the solution When binding a durable object using RPC that was defined in a different worker, it fails with: Cannot access
MyDurableObject#myMethod
as Durable Object RPC is not yet suppor...I wanted to be able to keep
WorkerA
behind ZT but allow WorkerB
outside of it
I'm trying to bind to its DO. Let me give that a try.Ah, now I get the "true" error:
Ahh, yes. I just checked with a deploy, and it worked. Thanks!