Vercel 504 Bad Gateway Error Page though code works in dev mode
Asked Answered
G

0

8

So I have built a Next app based on this NextJS example which means I have GraphQL routes and an Apollo server I use to fetch from the API in the app. The example shows how to fetch in getStaticProps() which works fine for me but I need to implement getServerSideProps() since the content served depends on the URL query and params which are up to 6000 different URLs so I cannot use getStaticPaths(). The code works completely fine in development mode... however when deployed to Vercel, it works in the beginning and sometimes later but shows 504 BAD GATEWAY error on the page like 95% of the time.

Code for [s]/[v].tsx:https://pastecord.com/uwojuzudaw.typescript

Gremlin answered 12/4, 2021 at 6:15 Comment(2)
Any news on this topic? I get the same issue, deploying a page with a dummy getServerSideProps breaks on Vercel (like you, 95% of the time. When it works once then it's fine for a while). If I remove getServerSideProps, then it works 100% of the time. Seems like a bug on Vercel to meNimiety
Got the same error. We only have basic database operations and it still doesn't work. Didn't find anything which might cause these delays. On local dev and prod mode, the API needs less than 2 seconds.Earp

© 2022 - 2024 — McMap. All rights reserved.