skip to Main Content

I have a NestJS application that I have just deployed using Vercel.
Using Node 16+, MongoDB 4.12.1, Mongoose 6.8.0

For some reason, all my requests are getting a timeout after 10 sec (which is the maximum for Vercel’s free tier).
Following my investigation, I didn’t got any timeout for endpoints that are not calling MongoDB, so I assume that this is the problem.
When I am running my application locally, it works like a charm, even using the vercel-admin-user credentials.

I have done the following for the integration:

  1. Integrated MongoDB Atlas with Vercel following their guide: link
  2. Created a vercel-admin-user with read and write access in MongoDB cluster
  3. Allowed all network access to my cluster (0.0.0.0 & the exact Vercel IP address)

2

Answers


  1. go to the mongodb account. then go to the database access. here you will see the new user called vercel-admin-user. then edit the user and set new password for it. then go to your project souce code change the mongodb pass & user in uri.

    Login or Signup to reply.
  2. Make sure:

    • In environment-variables you have exactly MONGODB_URI.
    • From your checkout page you’re sending data to correct url (not with localhost).
    • Add MongoDB at your Vercel account’s integration section for your project.https://vercel.com/dashboard/integrations
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search