NextAuth error on Vercel Product

Hello,

I developed my Website with next.js on my local desktop, when I build it to Vercel, I get an error in the website console (See photo).

On my local app nextAuth works, but not on Vercel, I tried everything, but nothing works. I hope that someone with experience can help me with this issue.

I use NextAuth for my login page. My provider is Discord, and this is my Environment Variables:

DISCORD_CLIENT_ID={clientId}
DISCORD_CLIENT_SECRET={secretId}
NEXTAUTH_URL=https://onelife-website.vercel.app

  • I redacted the client and secret because it is sensitive information

if I missed something, please let me know.

Hi, @legalproducts!

I found this discussion on Reddit that may be helpful, sharing it here →

Hey @legalproducts

Do you have the catch-all api route setup for app/api/auth? I’m seeing a 404 like your screenshot suggests. usually if that is the case, there is sometimes a configuration issues either around vercel.json or next middleware with rewrites or redirects.

Let me know, happy to dig in more!

1 Like