itslekanI
Convex Community14mo ago
2 replies
itslekan

Error: `headers` was called outside a request scope.

I recently switched devices and I wanted to continue working on my project. So I pulled all the code from github and ran convex dev. Everything seemed to be working find and even the env's got filled in as well. This project is currently running in production on vercel so I know it works. But when I try to run it I keep getting this error

Error: `headers` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context


After some debugging. I've norrowed down the problem to be in the convexAuthNextjsMiddleware. I cleared my previous middleware and copy pasted the default middleware and still the same error. I can't figure out what I'm doing wrong.

I'll appreciate any help I could get. Thank you.
Was this page helpful?