Open syedtabeeb1992 opened 3 years ago
You probably don't have an .env
file and because of that, your server isn't running.
See server/index.js :205
You can solve it by doing one of these:
} else if (process.env.NODE_ENV === "development") {
with this line:
} else {
NODE_ENV=development
& add require('dotenv').config();
at the top of index.jsUpdate proxy to {createProxyMiddleware}
I faced similar problem with my project and this solution worked for me
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) { app.use(createProxyMiddleware("/auth", { target: "http://localhost:5000" })); };
Once i run the project n click on fb/Insta login, it throws an error "Error occured while trying to proxy to: localhost:3000/auth/facebook"
in the console "Proxy error: Could not proxy request /user from localhost:3000 to http://localhost:5000/."
My package.json ..
"scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "server": "nodemon server/index.js", "dev":"concurrently --kill-others \"npm run start\" \"npm run server\" " }, "proxy": "http://localhost:5000/",
setupProxy.js
`const proxy = require("http-proxy-middleware");
module.exports = function(app) { app.use(proxy('/auth', { target: 'http://localhost:5000/' })); };
`