local agent dev -> "RPC error: Error: Method toJSON does not exist"
for the life of me, I cannot figure out why this RPC call is failing. Near as I can tell, when toJSON is not available, it means the durable object isn't available? my local DO seems to exist in .wrangler and naming agrees with my wrangler.jsonc, so idk if this is an agent thing or what.
Happy to provide more here, but idk what to share.
signed, nearly dead from this in Atlanta ☠️
--
via browser console:
via agent worker terminal:
4 Replies
if this helps, here's
npm list depth=0
Do you have a toJSON() method defined in your Agent/DO class?
I'll try manually creating one. My best guess is that the object being checked was the Agent-as-a-DO stub, which should have it anyway. good idea tho
OK, shockingly, this fixed the error, but I'm failing to understand why this is different from any other DO/websocket interface.
@1984 Ford Laser you're a champ
my first car was a 78 chevy nova, tho, sorry
I couldn't find any reference to a toJSON() function being included in the Agents SDK, unless I'm missing something. Good to hear you got it sorted though