If you get this error after deploying your application on Vercel, trying to retrieve the data but it turns out error 504(Default timeout). Do this:
For me I was using #MONGODB, #nextjsAPI, #Vercel for deployment when facing that error. I dont't know if it can work for others