I have done everything according to the instructions.
I have created a Mongo DB atlas account and even set up the connection in the mongo db uri but upon connecting I keep getting this error
The uri parameter to OpenUri must be a string but got undefined.Make sure the first parameter to mongoose.connect or mongoose create connection is a string
in the console.
I am using the boilerplate editor.
Kindly help if you have encountered such an error
Add a callback function to handle any errors that might occur during the connection process.
Ensure that the .env file is properly configured and the MONGO_URI variable is set to a valid MongoDB connection string.
Thank you for the reply but all this is log this in the console that there is an error connecting to the database.
My question is how to connect to the db using replit as my editor?
The error “The uri parameter must be a string, got ‘undefined’. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string” occurs when the MONGO_URI is not being properly read from the environment.
The repl didn’t wake up in time…
Thanks …I posted the first thread unknowingly…
Anyway I fixed the bug and there is a lot missing in the instruction part about converting the sample.env files to env since Replit does not support env files.