Got CORS error accessing services.arcgisonline.com from localhost (debugging locally). This was happening with just referencing basemaps, which are apparently linking to services.arcgisonline.com.
Current js library version is js.arcgis.com/3.41.
Using workaround during map initialization, which seems to work:
if (esri.config.defaults.io.corsEnabledServers.indexOf('services.arcgisonline.com') !== -1)
esri.config.defaults.io.corsEnabledServers.splice(esri.config.defaults.io.corsEnabledServers.indexOf('services.arcgisonline.com'), 1);
which basically removes 'services.arcgisonline.com' from the esri.config.defaults.io.corsEnabledServers array.
But is there a standard way of preventing this cors error?