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

Tiles are not showing after some layer-switching #201

Open
thomasneirynck opened this issue May 12, 2020 · 6 comments
Open

Tiles are not showing after some layer-switching #201

thomasneirynck opened this issue May 12, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@thomasneirynck
Copy link
Contributor

Go to the landing page and switch a few boundary layers.

This will get logged:

2mapbox-gl.js:33 Uncaught (in promise) Error: Style is not done loading
    at r._checkLoaded (mapbox-gl.js:33)
    at r.addSource (mapbox-gl.js:33)
    at n.addSource (mapbox-gl.js:33)
    at s.value (map.js:164)
    at app.js:70
    at l (runtime.js:45)
    at Generator._invoke (runtime.js:274)
    at Generator.forEach.e.<computed> [as next] (runtime.js:97)
    at d (main.bundle.js?0fa4f70aedbd095bb70d:1)
    at i (main.bundle.js?0fa4f70aedbd095bb70d:1)
mapbox-gl.js:33 Uncaught (in promise) TypeError: Cannot read property 'version' of undefined
    at r.serialize (mapbox-gl.js:33)
    at n.getStyle (mapbox-gl.js:33)
    at s.value (map.js:141)
    at s.value (map.js:156)
    at app.js:87
    at l (runtime.js:45)
    at Generator._invoke (runtime.js:274)
    at Generator.forEach.e.<computed> [as next] (runtime.js:97)
    at d (main.bundle.js?0fa4f70aedbd095bb70d:1)
    at i (main.bundle.js?0fa4f70aedbd095bb70d:1)

The tiles will fail to show as well.

Haven't found a reliable way to reproduce.

@thomasneirynck thomasneirynck added the bug Something isn't working label May 12, 2020
@jacknkandy
Copy link

jacknkandy commented Nov 27, 2020

Uncaught (in promise) Error: Style is not done loading
    at r._checkLoaded (mapbox-gl.js:33)
Uncaught (in promise) TypeError: Cannot read property 'version' of undefined
       at r.serialize (mapbox-gl.js:33)

I've been getting these errors for years with an application I maintain. I rarely encounter this myself, but I see it in the error logs for other users. Would love to hear if anyone ever narrows it down!

@jsanz
Copy link
Member

jsanz commented Nov 27, 2020

Interesting, I've seen that error on this project I'm contributing as well

https://geochicasosm.github.io/lascallesdelasmujeres/

That map does not change full styles and I was wondering if it would be related to adding the GeoJSON data too soon somehow. In this project I've seen it pretty frequently in development so it should be easier to investigate.

@jacknkandy
Copy link

Oh yeah I should mention that I am not using the ems-landing-page package (my bad I searched for this error on google and though I was in the mapbox-gl repo). I would presume that this error is unrelated to ems-landing-page and directly related to the underlying mapbox/mapbox-gl-js package.

@thomasneirynck
Copy link
Contributor Author

thomasneirynck commented Nov 30, 2020

thx @jacknkandy @jsanz for the confirmation.

Kibana explicitly waits for the Map:load event before adding any data with addSource

https://github.com/elastic/kibana/blob/658ecb6c8a97a6d182fb0e2907dc81cbd4a0c817/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.js#L164

https://docs.mapbox.com/mapbox-gl-js/api/map/#map.event:load

It doesn't seem like the ems-landing-page is doing this, so maybe this is the reason for the error logs.

@jsanz
Copy link
Member

jsanz commented Nov 30, 2020

On the women's streets project the viewer also waits for the load event.

https://github.com/geochicasosm/lascallesdelasmujeres/blob/master/src/services/MyApp.js#L66-L76

I tried now to reproduce it there and I couldn't trigger the error, I'll keep checking.

@jsanz
Copy link
Member

jsanz commented Dec 1, 2020

I tried to reproduce the error without success: in development and on production, Firefox and Chromium browser, throttling the network, and switching basemaps but no luck 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants