I'm getting a 500 error on sub pages of my nextjs site

When deploying my nextjs site, I can see the home page, but when navigating to another page like (like /login, /optional-session, /realtime, /required-session) I get a 500 error.

There are no build errors, and when I use netlify dev --context production, it works as expected.

Hi can you provided the following: [Support Guide] Netlify Support asked for the 'x-nf-request-id' header? What is it and how do I find it?