mongodb – how to fix that


(node:18000) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
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.createClient (C:\Users\AD\Downloads\readBook-main\readBook-main\Backend\node_modules\mongoose\lib\drivers\node-mongodb-native\connection.js:206:11)
    at NativeConnection.openUri (C:\Users\AD\Downloads\readBook-main\readBook-main\Backend\node_modules\mongoose\lib\connection.js:755:34)
    at Mongoose.connect (C:\Users\AD\Downloads\readBook-main\readBook-main\Backend\node_modules\mongoose\lib\index.js:404:15)
    at Module.connectDB [as default] (C:/Users/AD/Downloads/readBook-main/readBook-main/Backend/src/config/database.js:11:61)
    at eval (C:/Users/AD/Downloads/readBook-main/readBook-main/Backend/src/app.js:33:30)
    at async instantiateModule (file:///C:/Users/AD/Downloads/readBook-main/readBook-main/Backend/node_modules/vite/dist/node/chunks/dep-df561101.js:55974:9)
MongoDB connect error: 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. ❌

I want to fix that error.



Source link

Leave a Comment