Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBrendan Layton
Front End Web Development Techdegree Graduate 19,956 PointsCORS error when using localhost
I've setup a local http server following the instructions provided, however I'm receiving the following CORS error in the console:
Access to script at 'https://unpkg.com/react-dom@16.7.0/umd/react-dom.development.js' (redirected from 'https://unpkg.com/react-dom@16/umd/react-dom.development.js') from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How do I get around this?
2 Answers
Shane Finlayson
13,174 PointsThat's awesome! One more thing I forgot to add was the link for Babel. Here it is if you need it.
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
Brendan Layton
Front End Web Development Techdegree Graduate 19,956 PointsIt worked a treat Shane. No more CORS errors. Thank you!
Shane Finlayson
13,174 PointsShane Finlayson
13,174 PointsI'm having the same issue as well! But try this, it seems to be working for me so far. I apologize in advance if this doesn't work for you.