NextJS Auth Login Internal Server Error 500

Hi There!, We’ve facing issues with production URL for my site. The build of this project is completely success without error or any issues but when we open this site on chrome or brave browser, we get the internal server error 500.

Here’s our web url:

Please kindly check and let us know about this issues that can be fix from our side or not.

@vileapvong Have you checked the Function logs for the site?

I just check it and got this error: “ERROR TypeError: file.startsWith is not a function”, but i have another website that similar to this one and its worked fine.

@vileapvong Irrespective of your other site working fine, if it’s your own code you could simply log what file is.

As per the error it’s probably just something other than a String, for example an Array or Object.



@nathanmartin i already check it on my site and i can’t find or i don’t use this function on my website.

@vileapvong Is there a visible Call stack at the point the error is reported?

If so, can you copy & paste it here, or provide a screenshot?

@nathanmartin just use the SSR from NextJS to check the context query for next route and checking Auth by context.req paras cookies only.

@vileapvong I didn’t ask what it does, I asked if there is a visible Call stack.

I don’t work for Netlify, I have no visibility beyond what you share here.

If your code has no references to file then the error may be in “literally anything else that’s executing”, so if you suspect it’s in something ‘Next’ or something ‘Netlify’ it may very well be… but if there’s a Call stack it’d usually reveal that.

(Note: I probably can’t fix whatever the issue is, I’m just hoping that by getting you to answer questions I ask, and subsequently provide more info, that when Netlify do spot this thread they’re more inclined to investigate for you)

There’s no call stack and one more things its came from the netlify function library plugins that give this kind of errors.

@vileapvong It does look like something they’ve had issues with in the past, as per this thread:

That thread also shows the kind of Call stack I was referencing, which clearly shows it as originating in Netlify code.

1 Like

Hi @vileapvong,

Thanks for reaching out! Sorry to hear about the issue. I see the latest build today is now using the latest version 4.41.3 of the Netlify/Next.js runtime (updated from 4.33.0), which should resolve the issue. Let us know if you’re still seeing this error.

Thanks for your respone @Melvin, I just deploy today with updating of new version of Netlify Plugin 4.41.3 and Its no longer error and work perfectly.

Amazing, glad to hear you got everything working! Thanks for coming back to let us know!