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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![carlosvasquez5](https://secure.gravatar.com/avatar/14a568b1246887a989a91dc488211dcf?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
carlosvasquez5
3,803 PointsCannot get past getting babel to work on my Windows 10 computer
I keep getting the following error ever since I got to the part of adding babel in the video:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:<file location>. (Reason: CORS request not http)
I installed python 3 onto my pc to attempt the other post's answer of "python -m SimpleHTTPServer", but it isn't working for me.
1 Answer
![Gergely Bocz](https://uploads.teamtreehouse.com/production/profile-photos/10824732/micro_T2V9CE3U7-U0161J53Y64-a9d4fa7bde18-48.jpg)
Gergely Bocz
14,244 PointsHi Carlos!
Keep in mind when reading my answer, that i'm not familiar with python as all my experience comes from javascript, and i haven't tested my solutions! Nevertheless, i hope they can help you!
While browsing the web, i found out that the python http server requires additional settings, therefore additional code to to enable CORS. The first example should work with python 3, but just in case i'll share the link to another.
Here is the first example by link and by code:
#!/usr/bin/env python
# Usage: python cors_http_server.py <port>
try:
# try to use Python 3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test as test_orig
import sys
def test (*args):
test_orig(*args, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
except ImportError: # fall back to Python 2
from BaseHTTPServer import HTTPServer, test
from SimpleHTTPServer import SimpleHTTPRequestHandler
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Access-Control-Allow-Origin', '*')
SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__':
test(CORSRequestHandler, HTTPServer)
And here is a link to the second example.
I hope it solves your problem! If not, try to ping someone else, who has experience with python!
Good luck, Gergő
Gergely Bocz
14,244 PointsGergely Bocz
14,244 PointsAlso I have just realized based on the topic that you don't necessarily need python http-server.
If the examples above don't work, simply try adding the node package 'http-server' with 'npm install http-server' and run the server from the command line with the command: 'http-server [path/to/project/folder]. Here is the documentation for that: NPM http-server