0

I'm using getServerSideProps' to get a parameter in the URL, no big deal, but when I upload my application to Vercel (Hobby plan) I have the following problem

This Serverless Function has timed out. Your connection is working correctly. Vercel is working correctly.

504: GATEWAY_TIMEOUT Code: FUNCTION_INVOCATION_TIMEOUT ID: > gru1::5g5x4-1687230420091-471e7398e9e4

If you are a visitor, contact the website owner or try again later. If you are the owner, learn how to fix the error and check the logs.

I tested the Pro plan, and when using vercel.json the problem is "solved"

{
   "framework": "nextjs",
   "functions": {
     "src/pages/[nickName]": {
       "memory": 3008,
       "maxDuration": 20
     }
   }
}

what's the best way?

iWozzming
  • 13
  • 3
  • So, on the hobby plan, max execution is 10 seconds, you're hitting this limit. Whatever you've got going on in your 'setServerSideProps', it's is doing a lot of heavy lifting, either that or it's hitting a problem that's slowing it down. What's in there? – James William Jun 20 '23 at 21:06
  • @JamesWilliam export const getServerSideProps: GetServerSideProps = async ({ query }) => { return { props: { nickName: query.nickName } }; }; – iWozzming Jun 20 '23 at 21:22
  • I know it's a simple operation, but why are you having all this processing for this? – iWozzming Jun 20 '23 at 21:41

0 Answers0