When I deploy on Netlify, all of my Dynamic Routes for my nextjs app result in a 500 error.
I can run npm run dev it runs fine on my localhost.
I can run netlify dev it runs fine on my localhost.
I can run npm run build and then npm run start and simulate the build process on my local environment and everything loads and runs fine.
However, when I actually deploy to Netlify, the app doesn’t work and everything is a 500 error.
For testing purposes, I set up a Vercel account and deployed the app over there, and everything works as expected, which leads me to believe this is a Netlify environment issue.
I don’t know of a way to capture the 500 errors to be able to track them down otherwise I would leave them here in this post, maybe this is something the support staff can assist me with or point me in the right direction.
You should be able to see in the logs in the Netlify dashboard what the actual error is.
What is your Next.js version? I had a Next.js application that would not deploy to Netlify successfully on any version past 13.4.19. The error was a strange one in the logs, but every page would result in a 500 error.
You might want to try a previous version, as Netlify is still working on supporting Next.js v14.