hey all, anyone have any experience with using durable objects from within next routes, locally? it

hey all, anyone have any experience with using durable objects from within next routes, locally? it doesnt seem like my DO is starting up right, when i attempt to get an id/stub everything is just undefined... I have something like this:

export async function GET(request: NextRequest) {
  const context = getRequestContext();

  let id = context.env.RATE_LIMITER.idFromName(new URL(request.url).pathname);
  const stub = context.env.RATE_LIMITER.get(id);

  console.log({ id, stub });

  return stub.fetch(request);
}


which is just giving me:

{
  id: constructor { name: undefined },
  stub: constructor { name: undefined, id: undefined }
}
 ⨯ Error [TypeError]: Failed to parse URL from [object Request]
Was this page helpful?