Skip to content
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

mapbox gl version 51. The user aborted a request #7614

Closed
pmaza opened this issue Nov 22, 2018 · 9 comments · Fixed by #9021
Closed

mapbox gl version 51. The user aborted a request #7614

pmaza opened this issue Nov 22, 2018 · 9 comments · Fixed by #9021
Labels

Comments

@pmaza
Copy link

pmaza commented Nov 22, 2018

mapbox-gl-js version: 51

browser: Firefox,Edge and Chrome

Steps to Trigger Behavior

  1. Loading the map on view init

Link to Demonstration

image

Expected Behavior

the map should load without any error

Actual Behavior

When the map is created, it cancel one of the request to get the style. It happens after update to version 51

@mourner
Copy link
Member

mourner commented Nov 22, 2018

A screenshot is not a link to demonstration. Unless this can be reproduced on a live minimal example (like this one), we won't be able to diagnose the issue.

Also, are you seeing anything wrong with the map behavior, or is it just about developer tools network tab indications?

@pmaza
Copy link
Author

pmaza commented Nov 22, 2018

Hi @mourner.
The map load correctly, the problem is that the engine try to get the style two times. One always fail, and the other works fine.
This is the console error message shown:

image

I can't give you more information, because it happens just when the map is loading.... Before the update it worked fine, without any error.

@mourner
Copy link
Member

mourner commented Nov 22, 2018

Since I'm not able to reproduce this on public examples, and you're refusing to provide a minimal test case, I'll have to close the issue because it's impossible to diagnose. Will reopen if there's enough information provided in the comments.

@mourner mourner closed this as completed Nov 22, 2018
@Eldrac
Copy link

Eldrac commented Jan 2, 2019

Noting that I received this same error in the console when I set a style in the map constructor then immediately changed the style with a call to map.setStyle. Clearly user error though and if anything it could just use a different error message :)

var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v9'
});

map.setStyle("mapbox://styles/mapbox/satellite-v9");

@pmaza
Copy link
Author

pmaza commented Jan 16, 2019

Noting that I received this same error in the console when I set a style in the map constructor then immediately changed the style with a call to map.setStyle. Clearly user error though and if anything it could just use a different error message :)

var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v9'
});

map.setStyle("mapbox://styles/mapbox/satellite-v9");

Thank you @Eldrac!

@samfader
Copy link
Contributor

@mourner Here's a minimal test case: https://jsfiddle.net/p48q0mvd/1/

What's interesting is that sometimes you need to click Run a few times in a row to get the error to trigger. Other times, it seems to happen when the map loads for the first time. The error:

Error: The user aborted a request. at mapbox-gl.js:29

Let me know if this helps for reproducing this issue.

@cs09g
Copy link
Contributor

cs09g commented Nov 25, 2019

using styledata event, it's okay though.

map.once("styledata", () => {
  map.setStyle("mapbox://styles/mapbox/satellite-v9");
});

@samfader
Copy link
Contributor

@cs09g I still can hit the User aborted a request error when using that code - https://jsfiddle.net/L3rchnge/.

@chloekraw
Copy link
Contributor

cc @asheemmamoowala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants