Next.js Discord

Discord Forum

Error when deploying the API on Vercel:

Unanswered
Chum salmon posted this in #help-forum
Open in Discord
Chum salmonOP
Testing the API locally works correctly; however, when testing on Vercel, an error occurs. Apparently, there is a significant delay in connecting to the database, resulting in a server timeout. This is puzzling because this issue does not occur locally. The problem is not related to environment variables or similar issues. The error occurs precisely at the moment when the code executes "await mongoose.connect(DB_CONEXAO_STRING);".

2 Replies