Next.js Discord

Discord Forum

Get a severless function 500 error at deploy

Unanswered
Angus0304 posted this in #help-forum
Open in Discord
[GET] /en?nxtPlang=en status=500

This repo runs perfectly fine locally without any errors. However, once deployed to Vercel, we encounter this runtime error, and we're clueless about where it might be failing.

Could you suggest any approaches to resolve this issue?

our repo: https://github.com/Chen-Hsien/ichichain

12 Replies

it will be like this
and in the browser will have this request
@Angus0304 Click to see attachment
there you have it, "document is not defined"
that's the error you need to fix
as for how to fix: you'll need to dig deep into your code to see which component is buggy, a tedious process in which you could have to comment and uncomment parts of your pages to see what specific component causes this error. this one i cannot help, you need to do it yourself
thanks
so this is about my codebase error right
but why will local run everything fine? It confused me
try local but prod mode, npm run build then npm start