-
Notifications
You must be signed in to change notification settings - Fork 681
Network Error: Failed to Fetch [CORS ERROR] #206
Comments
@amitosh1995 add |
@amitosh1995 Did you set |
The problem does not arrive when i clone the original repository of mirumee. It setups smooth, but when i fork the repository, and try to work on my repository then the problem appears. @maarcingebala yes i have listed the |
@piotrgrundas i did as you said. now CORS problem is resolved but its showing BAD REQUEST. |
@amitosh1995 U should add backend env var in storefront rather change that in
Summing up U need to set:
|
@piotrgrundas and @maarcingebala Thank you. I can see the UI after setting the env var But dashboard is not working and i cannot see the dashboard or user profile in the new UI. i have uploaded the screenshot |
Well, that's probably because locally dashboard is served from the backend and it's running on a different port. Remember to install npm packages and run Closing this ticket since the issue is resolved. |
If you were like me, then you probably missed the trailing slash. If you leave it out, then the initial OPTIONS request is for /graphql (NO TRAILING SLASH) won't match the URL pattern and gets redirected to /graphql/ with an HTTP status 302. |
I had put in backend |
The ALLOWED_HOSTS don´t need to be any, I have ALLOWED_HOSTS="127.0.01,localhost" and it runs as intended. I was missing the slash at the end of graphql. So |
I'm getting the same error even though I've tried all of the above :( |
Hi Phuc, did you eventually work out the error? |
@amitosh1995 , @haydenfoote , @ramirovazq HI guys, id you eventually work out the error? |
What I'm trying to achieve
I downloaded the saleor 2.2.0 release and its running properly on "http://localhost:8000/" with the old UI.
For the new UI, i downloaded the saleor-storefront. and completed all the steps including npm i and npm start
but when i run the new UI port "http://localhost:3000/" . Some portion of the UI is available but some Part shows "NETWORK ERROR : FAILED TO FETCH"
so i tried to debug the app from chrome console.. and it shows that the problem is associated with CORS and Access-Control-Allow-Origin' header contains multiple values .
Steps to reproduce the problem
What I expected to happen
… Can someone please explain why is this happening and how can i resolve this error ?
Screenshots
System information
Operating system: Windows 10 Professional 64 bit
Browser: Google Chrome
The text was updated successfully, but these errors were encountered: