Do RPCs work in localhost? 🤔
Haven't been able to make them work and getting a The RPC receiver does not implement the method "sendTestEmail" error even though I have the 2 workers services running.
1 Reply
I can see the following:
▲ [WARNING] This worker is bound to live services: TRANSACTIONAL_EMAIL_SERVICE (transactional-email-service)
Which makes me think wrangler does see the bound RPC service.
Plus I have set a compatibility_date = "2024-06-03"
for both my services (main and the bound RPC).
Holy shit! I figured it out my issue.
So one extra thing to have in consideration is that methods have to be written as part of the class prototype.
Like
WORKS
FAILS
Unsure if this is documented or not, but that was at least my issue 🙏
I imagine this has to be because the way workers need keep references to JS Objects when injecting RPCs? 🤔 Would be great if some CF folks could give some insight