1

I have a NextJs Application that has been deployed to vercel that has a dashboard/users route when trying to access this route, which uses SSR in the developer console I see that a request to /_next/data/ld-OZbjuY-alZAOD8xnFp/dashboard/users.json is made I think it is calling an Edge function but I don't know and that call is returning always a 504 error i really don't know why. on my local machine thinks works well but once deploy it keeps returning 504 error Here is the image of the error

enter image description here

I need help

Alexandre29
  • 57
  • 2
  • 8
  • Does this answer your question? [Getting a 504/502 error on api requests in Nextjs deployed on Vercel](https://stackoverflow.com/questions/67456980/getting-a-504-502-error-on-api-requests-in-nextjs-deployed-on-vercel) – Alex Rabin Mar 30 '23 at 00:54

1 Answers1

1

Vercel has a 10 second timeout for server less functions. The code you are running on getServerSideProps is taking longer than 10 seconds.

You will have to determine on your own what code needs to be changed in order for getServerSideProps to not take as long to run.

Alex Rabin
  • 262
  • 4
  • 13
  • I wrote an article on how to reduce your initial load time on Vercel: https://medium.com/@scott82anderson/avoid-cold-starts-on-vercel-with-next-ssr-7b28fbc38bcc – Scott Anderson May 30 '23 at 01:55