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

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 }) {
    console.log(serverData);

    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.