Wrangler types using "fetcher" type for RPC binding rather than Service

I have a binding in my wrangler.toml
services = [
{ binding = "TRACE_EXPORTER_SERVICE", service = "observability-service", entrypoint = "TraceExportService" },
]
services = [
{ binding = "TRACE_EXPORTER_SERVICE", service = "observability-service", entrypoint = "TraceExportService" },
]
However when using wrangler types command to generate types I get
TRACE_EXPORTER_SERVICE: Fetcher;
TRACE_EXPORTER_SERVICE: Fetcher;
But I believe it should be
TRACE_EXPORTER_SERVICE: Service<TraceExporterService>;
TRACE_EXPORTER_SERVICE: Service<TraceExporterService>;
Am I wrong here or missing something, or is this not supported yet with wrangler types? https://developers.cloudflare.com/workers/runtime-apis/rpc/typescript/
Cloudflare Docs
TypeScript
How TypeScript types for your Worker or Durable Object's RPC methods are generated and exposed to clients
4 Replies
Hard@Work
Hard@Work7mo ago
Is it binding to a different Worker, or the same Worker?
Sam
SamOP7mo ago
It’s binding to a different worker
Hard@Work
Hard@Work7mo ago
Yeah, its' expected that it doesn't fill in the type. wrangler doesn't know where it should pull the type from The Worker you are binding to might be available locally, but it might not
Sam
SamOP7mo ago
Ah I see thanks Yeah I guess that makes sense since you never explicitly point to the location of the other worker

Did you find this page helpful?