SuperblocksHQ / ethereum-studio

Official Ethereum Studio project repository. And IDE specially tailored to make it as simple as possible to onboard new users into the Ethereum ecosystem
https://ethereum.org/build/
GNU General Public License v3.0
187 stars 103 forks source link

CORS error when accessing API staging endpoint #232

Closed nathan-lapinski closed 4 years ago

nathan-lapinski commented 4 years ago

Environment/Browser

Latest from master MacOS Chrome 81.0.4044.138 Firefox 76.0.1

Description

I'm trying to get started with this repo, so I've forked the latest off of master. However, when I run the app locally and try to select a project (like Hello World), the API request to pull down any project from https://studio-api-staging.ethereum.org/v1/projects is producing a CORS error.

Screen Shot 2020-05-13 at 22 32 38

If I update the API_BASE_URL in packages/editor/.env to point to https://studio-api.ethereum.org instead of staging, everything works and I'm able to read project data from the API.

Steps to reproduce

  1. Pull down the master branch on https://github.com/SuperblocksHQ/ethereum-studio/
  2. Follow quick start instructions (npx lerna bootstrap --hoist & npm start)
  3. Navigate to localhost:4000 in Chrome or Firefox, select a project, and click on "create project"
  4. Check the console tab to see the CORS error.

Expected result

The project data should load in the editor when .env is configured to use API_BASE_URL=https://studio-api-staging.ethereum.org, since that's the default.

Actual result

A CORS error is occurring, and the project data is not loading in the editor when using https://studio-api-staging.ethereum.org.


Access to fetch at 'https://studio-api-staging.ethereum.org/v1/projects' 
from origin 'http://localhost:4000' 
has been blocked by CORS policy: 
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' 
header is present on the requested resource.
If an opaque response serves your needs,
set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Switching over to https://studio-api.ethereum.org works.

Reproducible

100% reproducable.

javier-tarazaga commented 4 years ago

Hi @nathan-lapinski !

Yeap we are conducting some re-adjustments in the staging cluster and this should be fixed in the next couple of days.

Btw we will also be open sourcing the backend as well so then you can fully work locally as expected.

nathan-lapinski commented 4 years ago

Thanks for the information, @javier-tarazaga ! Looking forward to developing with the backend code as well, once it is open sourced!

Ronhub88 commented 4 years ago

Welcome Mr...I'm confuse my haha

On Thu, May 21, 2020, 13:30 Nate Lapinski notifications@github.com wrote:

Thanks for the information, @javier-tarazaga https://github.com/javier-tarazaga ! Looking forward to developing with the backend code as well, once it is open sourced!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SuperblocksHQ/ethereum-studio/issues/232#issuecomment-631889577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOR4SQEMQJGDOBTQCUO6RYTRSS355ANCNFSM4M7YTIQA .

Ronhub88 commented 4 years ago

Thanks ya do for the information for to ...thank you so much

On Thu, May 21, 2020, 13:54 RONIZAM Razali notifications@github.com wrote:

Welcome Mr...I'm confuse my haha

On Thu, May 21, 2020, 13:30 Nate Lapinski notifications@github.com wrote:

Thanks for the information, @javier-tarazaga https://github.com/javier-tarazaga ! Looking forward to developing with the backend code as well, once it is open sourced!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/SuperblocksHQ/ethereum-studio/issues/232#issuecomment-631889577 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOR4SQEMQJGDOBTQCUO6RYTRSS355ANCNFSM4M7YTIQA

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SuperblocksHQ/ethereum-studio/issues/232#issuecomment-631896729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOR4SQAEE37IPKLXAXCM7TDRSS6Z3ANCNFSM4M7YTIQA .

Ronhub88 commented 4 years ago

I'm confuse here my Java script here also don't know why 🤯🤯🤯🤯

javier-tarazaga commented 4 years ago

Hi guys! This was fixed and staging is fully functional once again. Closing this issue for now. Thanks for reporting it!