If I set NODE_ENV=production everything works perfectly fine. The nextjs app is built and deployed, as it should be. However, if i simply set NODE_ENV=development, the build process always fails. In fact, it fails to build every single route/path in the nextjs project. Every route faces 2 errors:
Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted
There will always be differences between environments: development mode/Local, production mode/Render, etc. These differences need to be considered and configured as required for your own app in each environment.
The errors you shared have links to the NextJS docs, maybe that will point you in the right direction about the issue?
It’s also not usually advisable to run a Render service in a development mode, which often requires more resources for things like hot-reloading, on-the-fly compilation, etc. Use development mode locally, and production mode when deploying to Render.