Closed patfrat closed 5 years ago
This seems like the MIME type is being incorrectly set on the file downloaded from api.mapbox.com
. It's coming back as binary/octet-stream
but it should be application/javascript
. I'm not sure how to fix that though. @ChrisLoer do you know how to update the MIME type for this file on our API?
Yup, the MIME type was set incorrectly when we uploaded that version to S3. It should be fixed in the latest version: https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.1/mapbox-gl-rtl-text.js
ok thx
This is and will be an error on all occasions when the users are hosting the library on their server as well. The reason is that the extension is .min, which is not recognised by webservers MIME config.
I'd recommend renaming this file from .js.min to .min.js like in any other JS library.
In the meanwhile, users need to set up their MIME config particularly to handle this lib.
import { setRTLTextPlugin } from 'mapbox-gl' setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.2/mapbox-gl-rtl-text.js');
this warning appears in my browser console:
Deprecated: Future versions will refuse to execute script from 'mapbox-gl-rtl-text.js' because its MIME type ('binary/octet-stream') is not executable