Tell us what’s happening:
Describe your issue in detail here.
Since you cannot use a .env file I have included it on repl.it as a Secret (asterisks indicate my user, password, and db) as follows:
I have no spaces, have tried all solutions on forum from searches
I installed mongodb and mongoose via npm, and obviously required mongoose and set it to the variable mongoose
Nothing has worked…
Here’s the error I’m getting via console:
> fcc-mongo-mongoose-challenges@0.0.1 start /home/runner/boilerplate-mongomongoose
> node server.js
Your app is listening on port 3000
(node:77) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of null
at parseSrvConnectionString (/home/runner/boilerplate-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/core/uri_parser.js:50:23)
Your app is listening on port 3000
(node:218) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(node:218) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [cluster0-shard-00-02.sazke.mongodb.net:27017] on first connect [MongoError: bad auth : Authentication failed.
our app is listening on port 3000
(node:403) UnhandledPromiseRejectionWarning: MongoError: bad auth : Authentication failed.
at MessageStream.messageHandler (/home/runner/boilerplate-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/cmap/connection.js:272:20)