JedPapa / spotify-web-player

0 stars 0 forks source link

Error occurred while trying to proxy: localhost:3000/ #2

Closed JedPapa closed 2 months ago

JedPapa commented 2 months ago

Error occurred while trying to proxy: localhost:3000/ on http://localhost:3000/auth/login/. The error most likely came from setupProxy.js

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
    app.use('/auth/**',
        createProxyMiddleware({
            target: 'http://localhost:5000'
        })
    );
};

or package.json

{
  "name": "spotify-web-player",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "server": "node server",
    "dev": "run-p server start"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "dotenv": "^16.4.5",
    "express": "^4.19.2",
    "http-proxy-middleware": "^3.0.0",
    "npm-run-all": "^4.1.5",
    "request": "^2.88.2"
  }
}
JedPapa commented 2 months ago

This issue was caused by the server not being active at runtime. Back to issue #1