After deploying nextjs app with nextAuth, I get 500 Server Internal Error

For all those affected, please share your site names.


Could you try downgrading to Next.js Runtime v4.36.1: Release plugin-nextjs: v4.36.1 · netlify/next-runtime · GitHub

This is how you can specify the exact version to use: GitHub - netlify/next-runtime: The Next.js Runtime allows Next.js to run on Netlify with zero configuration

Others… we would need to see your sites to confirm what issue you’re having exactly. If the error is exactly the same, you can try downgrading as well. If you’re only seeing some 500 errors without that error message, it might be a different error.


@hrishikesh ,

thanks for the fix, downgrading the runtime seems to have fixed the issue for me.

This also worked for me. Thank you.

I am not using next.js runtime manually. I think, netlify sites (UI) automatically do this. I have the same error. Is there any way that I can solve this problem on Netlify UI
Web site:

Hi there! This buggy behaviour is related to a bundling change i’m working on. For some context: Bundling the Netlify Functions currently takes a significant duration, for some sites more than 100secs. We found that this can be significantly reduced by using the .nft.json files that are documented by Next.js, to as low as a couple of seconds.

When I rolled this out (last friday), apparently there is some subtle bug that your sites were subjected to. I’ve reverted the rollout for now, and i’ll take a look at GitHub - VibeFoundation/testing-drizzle: Checking if drizzle works well with netlify to figure out what’s going on, if that’s okay with you @mast1999. I’ll post back here once I know more.

Thanks for bearing with me on this! Hopefully, your builds will be faster once i’m done :smiley:

1 Like

We’ve reverted the rollout. Your site should be working again, after you redeploy (see Manage deploys | Netlify Docs).


That’s totally fine with me. That’s a testing repo.

1 Like

My site is working well again. Thank you!

Thanks @skn0tt the site is not showing error any longer but now next-auth began not to work properly. When I try to login and fetching any url, I am having error. It was absolutely working in localhost two days before. Now I am having NEXTAUTH_URL client side fetching error for some reason. Session returns null and throw 401 error. I worked around server side rendering with MongoClient but I am not able to do client side fetching. Do you have any idea? I cleared also cookies. I am using next-auth 4.19.2 and next 13.1.6. In netlify, I used previous delpoy (about 7 days before) and everything works on production. For sure I cannot redeploy the site due to this reason.
Web site:

are you still experiencing this?

Hi there! Thanks for bearing with me. I’ve identified a fix and released it as part of Release plugin-nextjs: v4.38.0 · netlify/next-runtime · GitHub. The rollout has just been restarted, and i’ll be closely monitoring any impact of this.

If you find your site to be behaving weirdly in any deployments made after 10:00 CET today, please let me know.

This didn’t fix it for me, and based off of all the threads with similar complaints I’m not the only one. Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors - #57 by Danimoz and Error 500 nextjs 13 dinamic routing - #11 by designtoy.
I tried the hacky prebuild script, I tried setting __NEXT_PRIVATE_PREBUNDLED_REACT as an env var, I tried downgrading the netlify/nextjs-plugin to both 4.36.1 and 4.37.4, none of it worked for simple server side function:

function ServerComponent({ serverData }: { serverData: string }) {

    return <div>Data: {serverData}</div>;

export async function getServerSideProps() {
    // Server-side code to fetch data
    const data = process.env.NEXTAUTH_URL;

    return {
        props: {
            serverData: JSON.stringify(data),

export default ServerComponent;

Deployed on Vercel and everything worked so will probably make the switch.

The devs are aware of the issue and working on it.

Can you check this: Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors - #64 by hrishikesh?

Hi @prattusha,

I’d have to ask you to move your site away from Netlify. We don’t allow hosting clones and copyrighted material. If your account is reported (which happens fairly frequently), we’d be turning your account off.

Hi, I deployed my sight however when I go to the signup part of my site I keep getting the following error: “Server error There is a problem with the server configuration. Check the server logs for more information.” what can I change to fix this? I added my environment variables as well and set my next_auth to the site domain but I’m still getting the problem

My website:
My github repo: GitHub - prattushabw/InstagramClone

Hi @prattusha :wave:t6: Unfortunately, we are unable to provide assistance with your cloned Instagram site, as it violates our terms of service regarding copyright material. We kindly request that you delete this site within the next 24 hours. Failure to do so will result in the suspension of your site and account on our platform.

I’m having this same issue but downgrading does not resolve my issue. My site is

Thank you in advance for any help you can provide.

Hiya @JaysonThompson ,

Looks like this is due to some problem in your functions code. I can see more details in Netlify App when the 500 occurs, perhaps you can debug based on those errors?