Next.js Discord

Discord Forum

Error 504: FUNCTION_INVOCATION_TIMEOUT - Next.js Beginner

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Hello! I am a Next.js Beginner and I just deployed my first project to Vercel. Everything looks great but after one particular step, all functionality ceases and it returns the error: This Serverless Function has timed out.

No matter what I try, it keeps returning this error. Is there a quick fix I'm missing or have I goofed myself?

8 Replies

American black bearOP
okay so the free plan gives you 10 seconds to run the serverless function, and it times out after 10 seconds.
but it runs so fast on my local machine? is it just because the free plan runs on crappy computers??
@American black bear but it runs so fast on my local machine? is it just because the free plan runs on crappy computers??
normally it's more you code that is written bad. So improve your code quality and fetch only what you need and not everything
@American black bear then why does it run so fast locally?
There can be many reasons. Without seeing your full code, I can only guess
American black bearOP
would you be down to look through a portion of it that i think is the problematic part? its not very long.
@B33fb0n3 Yea, link me your GitHub repo and I will have a look
American black bearOP
can i dm it to you?