nextjs revalidate on-demand raise error 504

192 Views Asked by At

I have to revalidate two pages. The root "/" and a certain post eg. "posts/123".

All two revalidating work well on localhost but, on the Vercel when revalidate the root path, it raises error "504 deployment error"

enter image description here

1

There are 1 best solutions below

1
Martin Choutka On

Probably it's due to you hitting the Vercel limit on serverless API routes which is 10 seconds of runtime. Everything that takes longer is gonna cause this error.