# Heroku mongodb deployment error React course

**URL:** <https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297>\
**Category:** React\
**Created:** [October 27, 2020, 5:31pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297 "2020-10-27T17:31:24Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![Adina](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Adina](https://forum.codewithmosh.com/u/Adina)\
**Post date:** [March 18, 2021, 11:14am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/23 "2021-03-18T11:14:28Z")

</div>

How in the world do I solve this?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/5/57d11ef3db5e48a82768f922996d09c48b06d74b.png)  
this is a different project not vidly

---

<div class="post-metadata">

**Author:** ![Krishna](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@Krishna](https://forum.codewithmosh.com/u/Krishna)\
**Post date:** [March 18, 2021, 9:42pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/25 "2021-03-18T21:42:53Z")

</div>

@sampreeth Thank you so much for your detailed solution.

---

<div class="post-metadata">

**Author:** ![Ferdelance13](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Ferdelance13](https://forum.codewithmosh.com/u/Ferdelance13)\
**Post date:** [July 22, 2021, 10:13am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/26 "2021-07-22T10:13:11Z")

</div>

@sampreeth Thank you very much I’ve been stuck with connecting MongoDB Atlas and Heroku for half a day your answer saved me.

---

<div class="post-metadata">

**Author:** ![Ahmed22](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@Ahmed22](https://forum.codewithmosh.com/u/Ahmed22)\
**Post date:** [October 10, 2021, 12:00am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/27 "2021-10-10T00:00:56Z")

</div>

I can’t even thank you enough, because that problem already took me 2 days until I found your solution.  
again thank you for sharing the solution

---

<div class="post-metadata">

**Author:** ![nandhini](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@nandhini](https://forum.codewithmosh.com/u/nandhini)\
**Post date:** [October 30, 2021, 8:48am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/28 "2021-10-30T08:48:02Z")

</div>

> [@sampreeth](#):
>
> `{useNewUrlParser:true, useUnifiedTopology: true}`

thanks a lot, it really hepled

---

<div class="post-metadata">

**Author:** ![arifmd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/arifmd/32/3302_2.png) [@arifmd](https://forum.codewithmosh.com/u/arifmd)\
**Post date:** [February 16, 2022, 6:01pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/29 "2022-02-16T18:01:38Z")

</div>

As of February 2021, there are more issues coming up as in attached, hope to get some quick help around.

```auto
2022-02-16T17:56:40.728432+00:00 app[web.1]: stack: [
2022-02-16T17:56:40.728433+00:00 app[web.1]: 'Error: The provided mongoose instance is invalid',
2022-02-16T17:56:40.728433+00:00 app[web.1]: ' at Object.init (/app/node_modules/fawn/lib/fawn.js:30:15)',
2022-02-16T17:56:40.728434+00:00 app[web.1]: ' at Object.<anonymous> (/app/routes/rentals.js:10:6)',
2022-02-16T17:56:40.728434+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-02-16T17:56:40.728434+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)',
2022-02-16T17:56:40.728434+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-02-16T17:56:40.728435+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-02-16T17:56:40.728435+00:00 app[web.1]: ' at Module.require (node:internal/modules/cjs/loader:1005:19)',
2022-02-16T17:56:40.728435+00:00 app[web.1]: ' at require (node:internal/modules/cjs/helpers:102:18)',
2022-02-16T17:56:40.728436+00:00 app[web.1]: ' at Object.<anonymous> (/app/startup/routes.js:5:17)',
2022-02-16T17:56:40.728436+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-02-16T17:56:40.728436+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)',
2022-02-16T17:56:40.728437+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-02-16T17:56:40.728437+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-02-16T17:56:40.728438+00:00 app[web.1]: ' at Module.require (node:internal/modules/cjs/loader:1005:19)',
2022-02-16T17:56:40.728438+00:00 app[web.1]: ' at require (node:internal/modules/cjs/helpers:102:18)',
2022-02-16T17:56:40.728438+00:00 app[web.1]: ' at Object.<anonymous> (/app/index.js:8:1)'
2022-02-16T17:56:40.728438+00:00 app[web.1]: ]
2022-02-16T17:56:40.728439+00:00 app[web.1]: }
2022-02-16T17:56:40.737386+00:00 app[web.1]: (node:22) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
2022-02-16T17:56:40.737388+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2022-02-16T17:56:40.980590+00:00 heroku[web.1]: Process exited with status 1
2022-02-16T17:56:41.062608+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-16T17:56:42.355246+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vidly-api-arifmd.herokuapp.com request_id=2fa872f2-4e20-4e47-86c8-c0a0477f9e03 fwd="103.79.169.11" dyno= connect= service= status=503 bytes= protocol=https
2022-02-16T17:56:42.880868+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vidly-api-arifmd.herokuapp.com request_id=7d30fc63-d801-4303-b6da-8ef1eff36a9a fwd="103.79.169.11" dyno= connect= service= status=503 bytes= protocol=https
2022-02-16T17:56:48.325112+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/genres" host=vidly-api-arifmd.herokuapp.com request_id=fe215f4f-567a-4741-9003-80601a4aa421 fwd="103.79.169.11" dyno= connect= service= status=503 bytes= protocol=https
2022-02-16T17:56:48.974597+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/genres" host=vidly-api-arifmd.herokuapp.com request_id=9f027226-fa40-4a39-a532-fd321de29d4c fwd="103.79.169.11" dyno= connect= service= status=503 bytes= protocol=https
2022-02-16T17:56:49.419548+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vidly-api-arifmd.herokuapp.com request_id=def8ec17-15d0-4e50-9454-be25e0a5231a fwd="103.79.169.11" dyno= connect= service= status=503 bytes= protocol=https

```

---

<div class="post-metadata">

**Author:** ![arifmd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/arifmd/32/3302_2.png) [@arifmd](https://forum.codewithmosh.com/u/arifmd)\
**Post date:** [February 17, 2022, 5:29am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/30 "2022-02-17T05:29:48Z")

</div>

Just to test the issue further, I have reverted the mongoose version to `5.11.10 and getting another (I feel like) easier issue though followed all the steps about IP whitelisting but didn’t have any luck, something going wrong from mongodb side.

```auto
2022-02-17T05:19:10.997916+00:00 app[web.1]: stack: [
2022-02-17T05:19:10.997916+00:00 app[web.1]: "MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/",
2022-02-17T05:19:10.997917+00:00 app[web.1]: ' at NativeConnection.Connection.openUri (/app/node_modules/mongoose/lib/connection.js:832:32)',
2022-02-17T05:19:10.997917+00:00 app[web.1]: ' at /app/node_modules/mongoose/lib/index.js:345:10',
2022-02-17T05:19:10.997917+00:00 app[web.1]: ' at /app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:5',
2022-02-17T05:19:10.997918+00:00 app[web.1]: ' at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:300:9)',
2022-02-17T05:19:10.997918+00:00 app[web.1]: ' at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)',
2022-02-17T05:19:10.997918+00:00 app[web.1]: ' at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)',
2022-02-17T05:19:10.997918+00:00 app[web.1]: ' at promiseOrCallback (/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:30:10)',
2022-02-17T05:19:10.997919+00:00 app[web.1]: ' at Mongoose._promiseOrCallback (/app/node_modules/mongoose/lib/index.js:1135:10)',
2022-02-17T05:19:10.997919+00:00 app[web.1]: ' at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:344:20)',
2022-02-17T05:19:10.997919+00:00 app[web.1]: ' at module.exports (/app/startup/db.js:8:6)',
2022-02-17T05:19:10.997919+00:00 app[web.1]: ' at Object.<anonymous> (/app/index.js:9:24)',
2022-02-17T05:19:10.997919+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-02-17T05:19:10.997920+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)',
2022-02-17T05:19:10.997920+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-02-17T05:19:10.997920+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-02-17T05:19:10.997920+00:00 app[web.1]: ' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)',
2022-02-17T05:19:10.997921+00:00 app[web.1]: ' at node:internal/main/run_main_module:17:47'
2022-02-17T05:19:10.997921+00:00 app[web.1]: ]

```

---

<div class="post-metadata">

**Author:** ![arifmd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/arifmd/32/3302_2.png) [@arifmd](https://forum.codewithmosh.com/u/arifmd)\
**Post date:** [February 18, 2022, 3:02am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/31 "2022-02-18T03:02:49Z")

</div>

> [@sampreeth](#):
>
> copied connection string for **node driver version 2.2.12** will look like as shown below.

Copying connection string for node driver version 2.2.12 works for me, earlier I was trying to using the latest, hope it helps someone 🙂

---

<div class="post-metadata">

**Author:** ![xaek](https://avatars.discourse-cdn.com/v4/letter/x/45deac/32.png) [@xaek](https://forum.codewithmosh.com/u/xaek)\
**Post date:** [March 11, 2022, 12:31pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/32 "2022-03-11T12:31:24Z")

</div>

Hi all,

I have followed the steps outlined by @sampreeth as I was encountering a similar ‘circular dependancy’ error as encountered by @arifmd , but it hasnt solved the problem. My heroku logs are shown below. Any help would be much appreciated.

```nohighlight
 › Warning: heroku update available from 7.59.2 to 7.59.3.
Maximillans-MacBook-Pro-2:vidly-api-node ZULU$ heroku logs --tail
 › Warning: heroku update available from 7.59.2 to 7.59.3.
2022-03-11T12:28:34.040341+00:00 app[web.1]: method: '_compile',
2022-03-11T12:28:34.040341+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040342+00:00 app[web.1]: },
2022-03-11T12:28:34.040342+00:00 app[web.1]: {
2022-03-11T12:28:34.040342+00:00 app[web.1]: column: 10,
2022-03-11T12:28:34.040348+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040349+00:00 app[web.1]: function: 'Module._extensions..js',
2022-03-11T12:28:34.040349+00:00 app[web.1]: line: 1155,
2022-03-11T12:28:34.040349+00:00 app[web.1]: method: '.js',
2022-03-11T12:28:34.040349+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040350+00:00 app[web.1]: },
2022-03-11T12:28:34.040350+00:00 app[web.1]: {
2022-03-11T12:28:34.040350+00:00 app[web.1]: column: 32,
2022-03-11T12:28:34.040350+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040351+00:00 app[web.1]: function: 'Module.load',
2022-03-11T12:28:34.040351+00:00 app[web.1]: line: 981,
2022-03-11T12:28:34.040351+00:00 app[web.1]: method: 'load',
2022-03-11T12:28:34.040351+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040352+00:00 app[web.1]: },
2022-03-11T12:28:34.040352+00:00 app[web.1]: {
2022-03-11T12:28:34.040352+00:00 app[web.1]: column: 12,
2022-03-11T12:28:34.040352+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040353+00:00 app[web.1]: function: 'Module._load',
2022-03-11T12:28:34.040353+00:00 app[web.1]: line: 822,
2022-03-11T12:28:34.040353+00:00 app[web.1]: method: '_load',
2022-03-11T12:28:34.040353+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040354+00:00 app[web.1]: },
2022-03-11T12:28:34.040354+00:00 app[web.1]: {
2022-03-11T12:28:34.040354+00:00 app[web.1]: column: 19,
2022-03-11T12:28:34.040354+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040355+00:00 app[web.1]: function: 'Module.require',
2022-03-11T12:28:34.040355+00:00 app[web.1]: line: 1005,
2022-03-11T12:28:34.040355+00:00 app[web.1]: method: 'require',
2022-03-11T12:28:34.040356+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040356+00:00 app[web.1]: },
2022-03-11T12:28:34.040356+00:00 app[web.1]: {
2022-03-11T12:28:34.040356+00:00 app[web.1]: column: 18,
2022-03-11T12:28:34.040357+00:00 app[web.1]: file: 'node:internal/modules/cjs/helpers',
2022-03-11T12:28:34.040357+00:00 app[web.1]: function: 'require',
2022-03-11T12:28:34.040357+00:00 app[web.1]: line: 102,
2022-03-11T12:28:34.040358+00:00 app[web.1]: method: null,
2022-03-11T12:28:34.040365+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040365+00:00 app[web.1]: },
2022-03-11T12:28:34.040365+00:00 app[web.1]: {
2022-03-11T12:28:34.040365+00:00 app[web.1]: column: 15,
2022-03-11T12:28:34.040366+00:00 app[web.1]: file: '/app/startup/routes.js',
2022-03-11T12:28:34.040366+00:00 app[web.1]: function: null,
2022-03-11T12:28:34.040366+00:00 app[web.1]: line: 6,
2022-03-11T12:28:34.040367+00:00 app[web.1]: method: null,
2022-03-11T12:28:34.040367+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040367+00:00 app[web.1]: },
2022-03-11T12:28:34.040367+00:00 app[web.1]: {
2022-03-11T12:28:34.040368+00:00 app[web.1]: column: 14,
2022-03-11T12:28:34.040368+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040368+00:00 app[web.1]: function: 'Module._compile',
2022-03-11T12:28:34.040368+00:00 app[web.1]: line: 1103,
2022-03-11T12:28:34.040369+00:00 app[web.1]: method: '_compile',
2022-03-11T12:28:34.040369+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040369+00:00 app[web.1]: },
2022-03-11T12:28:34.040369+00:00 app[web.1]: {
2022-03-11T12:28:34.040370+00:00 app[web.1]: column: 10,
2022-03-11T12:28:34.040370+00:00 app[web.1]: file: 'node:internal/modules/cjs/loader',
2022-03-11T12:28:34.040370+00:00 app[web.1]: function: 'Module._extensions..js',
2022-03-11T12:28:34.040371+00:00 app[web.1]: line: 1155,
2022-03-11T12:28:34.040371+00:00 app[web.1]: method: '.js',
2022-03-11T12:28:34.040371+00:00 app[web.1]: native: false
2022-03-11T12:28:34.040371+00:00 app[web.1]: }
2022-03-11T12:28:34.040372+00:00 app[web.1]: ],
2022-03-11T12:28:34.040372+00:00 app[web.1]: stack: [
2022-03-11T12:28:34.040372+00:00 app[web.1]: 'Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header',
2022-03-11T12:28:34.040373+00:00 app[web.1]: ' at Object.Module._extensions..node (node:internal/modules/cjs/loader:1185:18)',
2022-03-11T12:28:34.040374+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-03-11T12:28:34.040374+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-03-11T12:28:34.040374+00:00 app[web.1]: ' at Module.require (node:internal/modules/cjs/loader:1005:19)',
2022-03-11T12:28:34.040374+00:00 app[web.1]: ' at require (node:internal/modules/cjs/helpers:102:18)',
2022-03-11T12:28:34.040375+00:00 app[web.1]: ' at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)',
2022-03-11T12:28:34.040375+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-03-11T12:28:34.040375+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)',
2022-03-11T12:28:34.040376+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-03-11T12:28:34.040376+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-03-11T12:28:34.040376+00:00 app[web.1]: ' at Module.require (node:internal/modules/cjs/loader:1005:19)',
2022-03-11T12:28:34.040376+00:00 app[web.1]: ' at require (node:internal/modules/cjs/helpers:102:18)',
2022-03-11T12:28:34.040377+00:00 app[web.1]: ' at Object.<anonymous> (/app/routes/users.js:2:16)',
2022-03-11T12:28:34.040377+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-03-11T12:28:34.040377+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)',
2022-03-11T12:28:34.040378+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:981:32)',
2022-03-11T12:28:34.040378+00:00 app[web.1]: ' at Function.Module._load (node:internal/modules/cjs/loader:822:12)',
2022-03-11T12:28:34.040378+00:00 app[web.1]: ' at Module.require (node:internal/modules/cjs/loader:1005:19)',
2022-03-11T12:28:34.040378+00:00 app[web.1]: ' at require (node:internal/modules/cjs/helpers:102:18)',
2022-03-11T12:28:34.040378+00:00 app[web.1]: ' at Object.<anonymous> (/app/startup/routes.js:6:15)',
2022-03-11T12:28:34.040379+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1103:14)',
2022-03-11T12:28:34.040379+00:00 app[web.1]: ' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)'
2022-03-11T12:28:34.040379+00:00 app[web.1]: ]
2022-03-11T12:28:34.040379+00:00 app[web.1]: }
2022-03-11T12:28:34.047770+00:00 app[web.1]: (node:22) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
2022-03-11T12:28:34.047771+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2022-03-11T12:28:34.189951+00:00 heroku[web.1]: Process exited with status 1
2022-03-11T12:28:34.246062+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-11T12:29:04.225185+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calm-spire-07708.herokuapp.com request_id=b14ee7b7-882f-4a3e-96ae-a9fa149f9e0a fwd="86.179.98.215" dyno= connect= service= status=503 bytes= protocol=https
2022-03-11T12:29:05.307903+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calm-spire-07708.herokuapp.com request_id=9492fe81-cfa4-43d9-90b1-43538b76a900 fwd="86.179.98.215" dyno= connect= service= status=503 bytes= protocol=https

```

---

<div class="post-metadata">

**Author:** ![Joedy](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@Joedy](https://forum.codewithmosh.com/u/Joedy)\
**Post date:** [October 9, 2022, 4:56pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/33 "2022-10-09T16:56:07Z")

</div>

Your solution did it for me, thank you very much!

---

<div class="post-metadata">

**Author:** ![bkidd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/bkidd/32/236_2.png) [@bkidd](https://forum.codewithmosh.com/u/bkidd)\
**Post date:** [January 18, 2023, 3:19am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/34 "2023-01-18T03:19:02Z")

</div>

> [@sampreeth](#):
>
> `mongodb.net:27017/<dbname>?ssl=true`

I just want to add one thing: When you copy the cluster connection string in Atlas, it may not have a space for the database name . What worked for me was placing the database name right after the port number located before the SSL ([mongodb.net:27017/dbname?ssl=true](http://mongodb.net:27017/dbname?ssl=true)…) as shown in @sampreeth 's example. It was confusing that the cluster connection string did not have a dbname space. Thanks, @sampreeth Your instructions helped me update my Vidly movie app, and now it is running fine.  
Also, if your Vidly movie app is throwing a CORS error, then it very well could be that you have to make the updates suggested by @sampreeth including changing your connection string.  
Best! Brian

---

<div class="post-metadata">

**Author:** ![Valentin](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@Valentin](https://forum.codewithmosh.com/u/Valentin)\
**Post date:** [February 9, 2023, 7:24pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/35 "2023-02-09T19:24:48Z")

</div>

Sampreeth, thank you for sharing the solution! It made my day today =) This solution is still working at the moment.

---

<div class="post-metadata">

**Author:** ![Bravono](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/bravono/32/3426_2.png) [@Bravono](https://forum.codewithmosh.com/u/Bravono)\
**Post date:** [May 16, 2023, 9:19am UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/36 "2023-05-16T09:19:55Z")

</div>

This is the error I get all the time. I have tried every solution that has been provided in this thread but I have had no success. It’s been a month now since I have been stuck here. I need help seriously.

```auto
 "MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/",
2023-05-16T09:15:21.908461+00:00 app[web.1]: ' at Connection.openUri (/app/node_modules/mongoose/lib/connection.js:825:32)',
2023-05-16T09:15:21.908461+00:00 app[web.1]: ' at /app/node_modules/mongoose/lib/index.js:414:10',
2023-05-16T09:15:21.908461+00:00 app[web.1]: ' at /app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:41:5',
2023-05-16T09:15:21.908461+00:00 app[web.1]: ' at new Promise (<anonymous>)',
2023-05-16T09:15:21.908461+00:00 app[web.1]: ' at promiseOrCallback (/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:40:10)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at Mongoose._promiseOrCallback (/app/node_modules/mongoose/lib/index.js:1288:10)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:413:20)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at module.exports (/app/startup/db.js:8:6)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at Object.<anonymous> (/app/index.js:9:24)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at Module._compile (node:internal/modules/cjs/loader:1254:14)',
2023-05-16T09:15:21.908462+00:00 app[web.1]: ' at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)',
2023-05-16T09:15:21.908463+00:00 app[web.1]: ' at Module.load (node:internal/modules/cjs/loader:1117:32)',
2023-05-16T09:15:21.908463+00:00 app[web.1]: ' at Module._load (node:internal/modules/cjs/loader:958:12)',
2023-05-16T09:15:21.908463+00:00 app[web.1]: ' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)',
2023-05-16T09:15:21.908463+00:00 app[web.1]: ' at node:internal/main/run_main_module:23:47'
2023-05-16T09:15:21.908463+00:00 app[web.1]: ]
2023-05-16T09:15:21.908463+00:00 app[web.1]: }
2023-05-16T09:15:21.916291+00:00 app[web.1]: npm notice
2023-05-16T09:15:21.916358+00:00 app[web.1]: npm notice New minor version of npm available! 9.5.1 -> 9.6.6
2023-05-16T09:15:21.916558+00:00 app[web.1]: npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.6>
2023-05-16T09:15:21.916617+00:00 app[web.1]: npm notice Run `npm install -g npm@9.6.6` to update!
2023-05-16T09:15:21.916738+00:00 app[web.1]: npm notice
2023-05-16T09:15:22.050550+00:00 heroku[web.1]: Process exited with status 1
2023-05-16T09:15:22.088039+00:00 heroku[web.1]: State changed from up to crashed

```

---

<div class="post-metadata">

**Author:** ![Bravono](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/bravono/32/3426_2.png) [@Bravono](https://forum.codewithmosh.com/u/Bravono)\
**Post date:** [June 20, 2023, 9:23pm UTC](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/37 "2023-06-20T21:23:39Z")

</div>

Why is nobody trying to help me?

I have spent months now trying to deploy my React.

[Previous page](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297.md?page=1)
