I am trying to access a `DO` from a `next-on-pages` app (with the DO running on a second terminal -

I am trying to access a
DO
from a
next-on-pages
app (with the DO running on a second terminal - hono.dev app).

But I can't use RPC to call the DO functions. I get this error
Error: Cannot access `Counter#getCounterValue` as Durable Object RPC is not yet supported between multiple `wrangler dev` sessions.


This is the code I used to access the DO
export async function GET(request: NextRequest) {
  const counterId = getRequestContext().env.COUNTERS.idFromName('A');
  const stub = getRequestContext().env.COUNTERS.get(counterId);

  const counterValue = await stub.getCounterValue()

  return new Response(counterValue)
}


Here is the example repo you can run to recreate this error
https://github.com/clmnin/next-on-pages-DO-RPC
Was this page helpful?