TypeError: The RPC receiver does not implement the method "methodX"

Hello! I'm testing RPC feature between two Cloudflare Workers: Worker A (consumer) and Worker B (producer). Worker A is configured to consume a service from Worker B, but I'm encountering an issue where the named entrypoint for Worker B doesn't seem to work. If I remove the named entrypoint, everything functions as expected Worker A (Consumer)
wrangler.toml
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
entrypoint = "StorageService"

...
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
entrypoint = "StorageService"

...
Worker B (Producer)
// I have a durable object
export { StorageState }

export class StorageService extends WorkerEntrypoint<Bindings> {
async methodX() {
// Implementation
}
}

export default {
async fetch() {
return new Response("Hello world");
}
}
// I have a durable object
export { StorageState }

export class StorageService extends WorkerEntrypoint<Bindings> {
async methodX() {
// Implementation
}
}

export default {
async fetch() {
return new Response("Hello world");
}
}
I get an error when i try to call env.STORAGE_SERVICE.methodX() The RPC receiver does not implement the method "methodX" When I test it without using named entries, it works. Worker A (Consumer)
wrangler.toml
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
[[env.staging.services]]
binding = "STORAGE_SERVICE"
service = "storage_service"
Worker B (Producer) export default class StorageService extends WorkerEntrypoint<Bindings> { async methodX() { // Implementation } } Do you have any ideas on why this issue happens?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server