Cors issue on React App
- Teja_SatyaOP
Hi Team,
i am running
DAML Json-API on localhost:7575 and
my react App on localhost:3001I am able to get the responses from Json-API using postman
but while hitting the same url (‘http://localhost:7575/v1/query’) with react i am getting CORS issueplease find the below Screenshot and help me resolving this issue
Thanks in advance

- rohitt
Hi @Teja_Satya
I suspect this is due to your browser blocking these requests as it does not comply with Same-origin policy .
Specifically, your UI is running onlocalhost:3001while you have the JSON API running onlocalhost:7575. Browsers will block these requests by default as a security measure. - rohitt
To remedy this consider using something like NGINX as a reverse proxy to make sure that your UI and the JSON API run on the same host and port or a webpack proxy as mentioned in this example.
- Teja_Satya
Hi Rohitt,
we are using the same setupProxy.js( which is used by navigator )in my react app but still we are getting the CORS error,
I don’t understand how navigator is working fine but not our application which almost do the same job ,
please clarify

- Gary_Verhaegen
Having the proxy there doesn’t necessarily mean your app is going through it - make sure your calls to the JSON API from your application’s code use the proxy origin rather than trying to connect directly to the JSON API origin (typically, check that your app does not use the JSON API port explicitly).