I have this error , can someone help me to fix this ! 🤦‍♂️

(node:25787) UnhandledPromiseRejectionWarning: MongoParseError: URI does not have hostname, domain name and tld

1:32 PM

at parseSrvConnectionString (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/core/uri_parser.js:41:21)

1:32 PM

at parseConnectionString (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/core/uri_parser.js:553:12)

1:32 PM

at connect (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/operations/connect.js:291:3)

1:32 PM

at ConnectOperation.execute (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/operations/connect.js:202:5)

1:32 PM

at /rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/operations/execute_operation.js:98:26

1:32 PM

at new Promise ()

1:32 PM

at executeOperation (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/operations/execute_operation.js:91:10)

1:32 PM

at MongoClient.connect (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/mongo_client.js:219:10)

1:32 PM

at Function.MongoClient.connect (/rbd/pnpm-volume/f300775e-f7b6-47a5-ace2-e56fc448649b/node_modules/.registry.npmjs.org/mongodb/3.4.1/node_modules/mongodb/lib/mongo_client.js:389:22)

1:32 PM

Jump Toat Promise (/app/src/DBService.js:56:19)

1:32 PM

at new Promise ()

1:32 PM

Jump Toat DBService.connectDB (/app/src/DBService.js:55:12)

1:32 PM

Jump Toat Promise (/app/src/MusicClient.js:127:22)

1:32 PM

at new Promise ()

1:32 PM

Jump Toat MusicClient.connectDB (/app/src/MusicClient.js:126:12)

1:32 PM

Jump Toat new MusicClient (/app/src/MusicClient.js:76:10)

1:32 PM

Jump Toat loadSettings.then (/app/src/index.js:246:19)

1:32 PM

(node:25787) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

1:32 PM

(node:25787) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

That sounds like a connection problem with an URL connection string. Can you say the project name and double check the connection string which is being passes to the Mongo driver?

Yes, also after reading about the same error in other forums (just Google the error), it says that this error can happen if

  • You have not whitelisted 0.0.0.0/0 under Whitelist Entries. You need to whitelist 0.0.0.0/0 (access from anywhere) so that the MongoDB Database can be accessed from the Glitch project.
  • The password or username may contain special characters which needs to be encoded to URI to be passed in the connection string.