JavaScript React Basics First Steps in React Understanding JSX

I think there is problem with react, when I open developer tool in chrome (F12) It shows 1 error

babel.min.js:24 Access to XMLHttpRequest at 'file:///C:/Users/Pilotech/Desktop/React/my-app/public/scoreboard/app.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

2 Answers

Steve Gallant
Steve Gallant
14,884 Points

Because the URI starts with "file:///C:/", I'm guessing you are browsing to your file via the local Windows file system rather than running a local http server as previously described in the course. Make sure you are accessing the page via http in your browser, usually at http://localhost:8000 for the python method. Hope this helps!


Mike Hardy
Mike Hardy
Full Stack JavaScript Techdegree Graduate 16,258 Points

Thanks Steve. I had the same issue and following the steps for "Running a simple local HTTP server" in the Teachers notes in a previous video was the answer.

thank you I did it I used wamp , and it works