Hi, since a few days ago, I systematically got CORS issue when Studio connects to localhost. Any idea how to configure `langgraph.json`?
Error:
```
Access to fetch at ‘http://127.0.0.1:2024/assistants/fe096781-5601-53d2-b2f6-0d3403f7e9ca’ from origin ‘https://smith.langchain.com’ has been blocked by CORS policy: Permission was denied for this request to access the unknown address space.
```
Tried this with no luck in langgraph.json:
```json
“cors”: { “allow_origins”: [“https://smith.langchain.com”] }
```
Hey, do you mind sharing your langgraph.json file and describing the steps you’re taking to reproduce the issue?
@emilionavarro Yes you can give a shot at this code:
pip install --upgrade "langgraph-cli[inmem]"
langgraph new ./react-agent --template react-agent-python
cd ./react-agent
pip install -e .
# @see https://github.com/langchain-ai/react-agent/issues/26
pip install protobuf===6.3.1
langgraph dev
Nothing fancy apart from the protobuf install that seems required when using the template (otherwise runtime and generator won’t match).
So langgraph.json is:
{
"$schema": "https://langgra.ph/schema.json",
"dependencies": ["."],
"graphs": {
"agent": "./src/react_agent/graph.py:graph"
},
"env": ".env"
}
All that using Python 3.13.
1 Like
Hey @eric-burel ! A recent chrome update seemed to have included a flag/setting that blocks local networks access across origins. Could you try disabling this flag:chrome://flags/#local-network-access-check
2 Likes
I tested on Firefox before posting and it didn’t work either, but retrying now I am indeed only blocked in Chrome, so it must be it! However enabling the flag in Chrome didn’t seem to fix the issue. I’ll try again after a full computer restart maybe.
I feel like I get the same error on a deployed project, so it’s not the issue. There might have been a recent change in the langgraph API regarding CORS?
Hi, this is probably a different problem, the right URL should not have a trailing slash. So `http://localhost:2024` is your root url, not `http://localhost:2024/\`. Here I hit a CORS issue not a 404.
Jokes on me: figured you need to disable the flag, not enable it, I misread your comment!
I expected that enabling it would show a message like “do you want to allow connection to localhost?” or something a like, similarly to activating the microphone or webcam, but it just blocks everything with a CORS message.