atisawd / boxicons

High Quality web friendly icons
https://boxicons.com
MIT License
2.93k stars 295 forks source link

Google Chrome blocks due to CORS policy. #42

Open jack-greenberg opened 5 years ago

jack-greenberg commented 5 years ago

When working in Chrome, using the web components installed with npm install boxicons doesn't yield anything, due to the Cross-Origin Resource Sharing policy. This was the console error:

Access to XMLHttpRequest at 'http://unpkg.com/boxicons@2.0.2/svg/regular/bx-loader.svg' from origin 'http://localhost:5000' has been blocked by CORS policy: The response is invalid.

Do you know how I can fix this? I am using Flask and React as well, but I wouldn't think those would have any impact.

atisawd commented 5 years ago

i have used it in django projects , i havent faced this issue at least on my PC

jack-greenberg commented 5 years ago

While using Chrome?

atisawd commented 5 years ago

yup

Shrinks99 commented 5 years ago

I think this is due to Chrome blocking it when directly accessing the file from your local machine. Spinning up a web server for development (I personally like SimpleHTTPServer) fixed this problem for me. That said, you appear to have already done this based on that URL so I'm not really sure what your issue is specifically.