i’m using mongodb: ^4.13.0
here is the method i’m using to connect to mongodb when initializing the server
function connect() {
try {
if (!URI_DEV) throw new Error('URI is not added to your env variables');
const uri = URI_DEV;
const options = {
useUnifiedTopology: true,
useNewUrlParser: true
};
const client = new MongoClient(uri, options);
return client.connect();
} catch (err) {
throw new Error(err.message);
}
}
now when i’m checking the logs, they show me this error, and i can’t figure out why.
note that i’m using the same config and version of code and it works as expected.
can someone help me please to solve this problem. Thank you!
