CORS (cross origin request sharing) errors can be identified by checking for error messages in the console:
XMLHttpRequest cannot load file:///mapbox.js/assets/data/states.geojson. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
When you receive a CORS (cross origin request sharing) error, it means that the file you have opened is attempting to load external data, either from a relative or absolute URL:
const statesLayer = L.mapbox .featureLayer() // Grab some GeoJSON data from a relative URL .loadURL('https://docs.mapbox.com/mapbox.js/assets/data/states.geojson') .on('click', handleClick) .on('ready', resetStyles) .addTo(map);