Thanks @dawid.matuszczyk,
I’m running @auth0/nextjs-auth0@4.8.0 and next@15.3.5. I’ve tried cloning the working sample and get the same error, which makes it sound environmental (MBPro, M4 Max chip).
I am sorry about the delayed response to the issue that you were facing at the time.
Does this still persists by any chance?
I believe that the cause might be caused by you are calling await auth0.getSession() inside your middleware without passing the request object to it. You middleware.ts code should look something like this:
Hopefully, this will be useful for anybody else who stumbled upon the same issue. If you have found a different fix, please feel free to share it with the rest of us!