Aunthetication issues after deployment in Next.js 14

I’ve created a web app using Nextjs 14 with a Supabase backend deployed on Netlify. However, after successful authentication with Google, port 80 is being appended to my URL, which causes an error to be thrown.

The URL after authentication looks like this:

This leads Chrome to throw an error:

This site can’t provide a secure connection sent an invalid response.

I’ve tried manually replacing 80 with 443 in the browser URL, and the flow proceeds without an error.

Everything works fine in my local development environment and in my Netlify Deploy Preview, which means there’s some issue with my production environment.

How can I address this?

This is a known issue. It comes from: next-runtime/packages/runtime/src/templates/getHandler.ts at main · netlify/next-runtime (

No fix at the moment. It will directly be fixed in the upcoming changes to Next.js Runtime.

1 Like