Unable to start app - MongoParseError

I am unable to run npm start - the app crashes everyrime with this error :

MongoParseError: URI malformed, cannot be parsed
at parseConnectionString (C:\Users\chees\dev\mflix-js\node_modules\mongodb-core\lib\uri_parser.js:211:21)
at connect (C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:180:3)
at connectOp (C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:284:3)
at C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\utils.js:437:24
at new Promise ()
at executeOperation (C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\utils.js:432:10)
at MongoClient.connect (C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\mongo_client.js:168:10)
at Function.MongoClient.connect (C:\Users\chees\dev\mflix-js\node_modules\mongodb\lib\mongo_client.js:372:22)
at Object. (C:/Users/chees/dev/mflix-js/src/index.js:23:13)
at Module._compile (internal/modules/cjs/loader.js:805:30)
[nodemon] app crashed - waiting for file changes before starting…

Any ideas anyone?

In the dotenv_win or dotenv_unix file, what is your MFLIX_DB_URI= ?

I believe your MFLIX_DB_URI should also contain your username and password. It might not be the URI that you have in your atlas cluster settings.

Also, the readme recommends changing the SECRET_KEY to a random string.

Hope that gets it working.

All, thanks for the advice. I have now gone through the Readme file and followed everything and it now all works.

2 Likes