Mongoose and Promise Error
Issue 1:
[0] (node:3752) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 5 to cluster0-shard-00-02-bioze.mongodb.net:27017 closed
[0] at TLSSocket.
Issue 2:
[1] When specified, "proxy" in package.json must be a string.
[1] Instead, the type of "proxy" was "object".
[1] Either remove "proxy" from package.json, or make it a string.
[1] npm ERR! code ELIFECYCLE
npm ERR! errno 1
[1] npm ERR! [email protected] start: react-scripts start
[1] npm ERR! Exit status 1
[1] npm ERR!
npm ERR! Failed at the [email protected] start script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! C:\Users\Samsung user\AppData\Roaming\npm-cache_logs\2019-06-11T06_44_18_943Z-debug.log
[1] npm ERR! code ELIFECYCLE
npm ERR! errno 1
[1] npm ERR! [email protected] client: npm run start --prefix client
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the [email protected] client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Samsung user\AppData\Roaming\npm-cache_logs\2019-06-11T06_44_18_975Z-debug.log
[1] npm run client exited with code 1
I found a post on stackoverflow solution regarding the proxy issue, that says to create a separate setupProxy.js file and apply proxy in below way const proxy = require('http-proxy-middleware'); module.exports = function(app) { app.use(proxy('/auth/google', { target: 'http://localhost:5000' }, "/api/*", { "target": "http://localhost:5000" } )); } and delete the proxy from client/package.json, But this remains a temprory solution, and often the error appears regular
Issue 3: http://localhost:5000/api/current_user the page remains totally blank, no current user is shown
first error white list your ip address from your mongodb cluster. The setting is under security
Yes the setupProxy.js is the accepted solution. there is a text document update inside of the course
first error white list your ip address from your mongodb cluster. The setting is under security
Yes the setupProxy.js is the accepted solution. there is a text document update inside of the course
Big THANKS: It really worked. But now I'm facing a problem in Heroku deployment, and heroku logs shows chunk of errors, and on heroku server it shows: Cannot GET /
can you post a screenshot of the errors Heroku is showing you?
can you post a screenshot of the errors Heroku is showing you? Thanks for replly:



So I don't see the repo under your account, is it a private one?
I took a look at the error messages, it looks like something under the options to build out the create-react-app is failing