Black Lives Matter. Please consider donating to Black Girls Code today.

Cross-Origin Request Blocked with Dash and scattergeo

I am trying to create a scattergeo plot in Dash on a Windows 10 laptop.

I used this example (note if you copy and paste the example, it is missing a dash.Dash() line at the beginning). However, when I run the app server and navigate to the app in firefox, I get the plot title and the legend but the actual map does not appear. Looking into the console in firefox, I see that the:

GET XHR https://cdn.plot.ly/usa_110m.json request returns “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote rsource (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘null’)” However, if I navigate to the app in Internet Explorer, the plot does appear.

As an added twist, I get the same behavior when I execute the same process in an Ubuntu 16.04 virtual box on the same laptop but not when I do it on a different laptop with Ubuntu 16.04.

Can anyone advise as to what the problem is and if there are any potential fixes?

1 Like