1

When I run npm start it throws this error:

Proxy inside package.json must be a string react issue

Here is how it looks inside package.json:

"private": true,
  "proxy": {
    "api/v1/*": {
      "target": "localhost:4444"
    }
  },
  "dependencies": {...

How can this be fixed? What is wrong?

1

2 Answers 2

1

The support of specifying the different paths in the package.json was dropped in create-react-app v2. To also support this functionality, you have to use a setupProxy.js.

For more information checkout the documentation here:

https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually

Sign up to request clarification or add additional context in comments.

Comments

1

try adding

'http://' 
 "proxy": {
    "api/v1/*": {
      "target": "http://localhost:4444"
    }
  },

to your pacakge.json file

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.