Next-auth is failing with a 404 not found on the /auth/signin endpoint. Could it be the env variable format?

I’m able to configure next-auth with a github login correctly on local.

When I go to localhost:3000/api/auth/signin I see the “Sign in with Github” button.

When I deploy to render and try in production I get a 404 | This page could not be found.

I see [next-auth][error][client_fetch_error] in the browser console, which points me to the environment variable NEXTAUTH_URL not being correctly set. I’ve set this env variable along with NEXT_PUBLIC_NEXTAUTH_URL.

Any ideas?


Hi @kbhardwaj , I see that your Render services are all static sites, which means we only serve the static assets that are built when your service is deployed, and don’t run any server process. If you’d like to take advantage of Next.js’s server-side features like signin, you’ll need to create a Render web service instead of a static site. Taking a look at our Deploy a Next.js App - Deploy as a Node Server doc is a good place to start.