Mongodb cannot connect

What could actually be the cause of this error. it was solve by some one in my first project, this time I will like to know the cause of it. please help

(node:2688) UnhandledPromiseRejectionWarning: MongooseError: The uri parameter to openUri() must be a string, got “undefined”. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.

at NativeConnection.Connection.openUri (/rbd/pnpm-volume/aedea735-e84b-4510-8772-e22d02b7ffd9/node_modules/.registry.npmjs.org/mongoose/5.13.3/node_modules/mongoose/lib/connection.j

Does the console.log show the actual MONGODB_URI when you log that connecting message?

1 Like

I don’t really understand your question but NO nothing show from console log. I made the connection from …env file expected to see successful connection to MONGO_URI, And then the error. I sent the link to the project in case you will like to look at thanks

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.