Next.js private database URL
I am deploying a Next.js app on Railway, where I also have a database hosted.
On my home page '/', I make a database call.
In production, I am using a private URL for the database to reduce network usage.
However, when Next.js is building, it is trying to prerender the page and the private URL hasnt initialised yet, causing the build to fail.
Is there a way around to fix this to continue using the private URL, or do I need to use the public one?
3 Replies