node.jsnetlify

i am getting data on my local port : 9999 node app but facing 502 error while running the same app on the netlify


{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"MongooseError: Operation `users.find()` buffering timed out after 10000ms","trace":
["Runtime.UnhandledPromiseRejection: MongooseError: Operation `users.find()` buffering timed out after 10000ms","
    at process.<anonymous> file:///var/runtime/index.mjs:1276:17)","
    at process.emit (node:events:517:28)","
    at emit (node:internal/process/promises:149:20)","
    at processPromiseRejections (node:internal/process/promises:283:27)","
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}

I got this error while making a get request to a node app deployed on netlify. I was able to get data of the same app when I am running it on my local port 9999, basically the connection is correct to mongoDB.

I tried running my app on my local port 9999 and I received all data in GET request, but it is not happening when I run the same app on netlify deployed app. Kindly assist.


Solution

  • "useNewParser : true" in mongoose.connect(URI , {useNewParser:true}) worked in my case , as i just followed every option given in mongoose document of mongoose connection .