Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leaflet.js fails to load with CORS policy violation error #1

Open
justdmitry opened this issue Nov 5, 2019 · 0 comments
Open

leaflet.js fails to load with CORS policy violation error #1

justdmitry opened this issue Nov 5, 2019 · 0 comments

Comments

@justdmitry
Copy link

Browser fails to load map page with this errors in console:

Firefox:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://unpkg.com/[email protected]/dist/leaflet.js. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘https://www.weather-forecast.com’).

Chrome:

Access to script at 'https://unpkg.com/[email protected]/dist/leaflet.js' from origin '' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://www.weather-forecast.com' that is not equal to the supplied origin.

It seems that unpkg.com have problems with CORS headers (again). Problem is traced at mjackson/unpkg#176, most robust solution up to date is do not use unpkg in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant