Meeting Edge runtime issue migrating to @auth0/nextjs-auth0 v0.4

Hi,

I’m migrating to @auth0/nextjs-auth0 v0.4 following the guide in the github doc. I’m meeting an issue where when the auth0 page tries to call /api/callback it raise error

!!!!!!!!url: /auth/callback
[Error: A Node.js API is used (setImmediate) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime]
 ⨯ uncaughtException: [Error: A Node.js API is used (setImmediate) which is not supported in the Edge Runtime.

Not sure what this happens as from my understanding, this path is offered by the middle ware.

import type { NextRequest } from "next/server";

import { middleware as userPagesMiddleware } from "@/app/(ui)/(user)/u/middleware";
import { auth0 } from "@/auth0";

export async function middleware(request: NextRequest) {
  console.log(`!!!!!!!!url: ${request.nextUrl.pathname}`);
  // auth0 middleware registration
  const authRes = await auth0.middleware(request);
  console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~`);

  return authRes;
}

Found the issue. Turns out all the code in constructing auth0 client should also be edge-compatible.