-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Use of fetch API breaks cordova apps #7603
Comments
Yeah, we should probably switch to XHR when requesting a URL with a file protocol. Would you like to do a PR with the fix? cc @kkaefer |
It looks like no browser allows access via
|
This behaviour is disabled in the webview cordova uses (only for xhr, not for fetch, it's probably not possible for fetch). Unfortunately I think it's not trivial to test it out, you need to install cordova, make a sample project and run it on a device. I can help with the testing. |
I am also using ionic 3 which use cordova for building ios and android application. In my application it is working fine. I seen my application running on local web server. |
@gpiffault This should be fixed in #7818. |
I have the same problem. I use mapbox in react project with cordova but my pins images aren't loaded. Downgrading to 0.50.0 works fine. I also use relative paths. |
@gpiffault I will test your commit and report here. Perhaps they can take it to the actual version. |
mapbox-gl-js version: 0.51.0
browser: Chrome 70 (webview)
#7371 introduces a bug in cordova apps loading local assets. The fetch API doesn't support the
file:
scheme whereas xhr does (JakeChampion/fetch#92 (comment)) so when style specification or images are stored locally, they won't load after 0.51.0 (works fine up to 0.50.0).For reference, I commented on the commit here eec8cd5#commitcomment-31351193
The text was updated successfully, but these errors were encountered: