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

[web] WebGL contexts. Oldest context will be lost. #639

Closed
samu-developments opened this issue May 21, 2021 · 5 comments
Closed

[web] WebGL contexts. Oldest context will be lost. #639

samu-developments opened this issue May 21, 2021 · 5 comments

Comments

@samu-developments
Copy link

Hi,

Since the first time I tried my app on web I have received these errors in the console:
WARNING: Too many active WebGL contexts. Oldest context will be lost.
and
Flutter: restoring WebGL context.
The map works fine in the beginning, but after navigating to another screen and back, or sometimes when resizing the window, these error start to appear. After a short while the map crashes, however the rest of the app continue to work.

image

My map
image

The error do seem to be related to Flutter issue flutter/flutter#75914, however I've not seen anyone else using MapBox report this, so maybe I'm doing something wrong.

Using --web-renderer html seem to work, however does not look as nice as canvaskit.

@pravsterrr
Copy link

Did you find a solution/ fix for this? Having the same issue with Android browsers running the html renderer

@samu-developments
Copy link
Author

No unfortunately not

@metafounder
Copy link
Contributor

I am also experiencing this on web, both html and canvaskit renders

@stale
Copy link

stale bot commented Jan 22, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 22, 2022
@stale stale bot closed this as completed Jan 29, 2022
@webprofusion-chrisc
Copy link

For what it's worth this also happens in standard mapbox_gl js in a standard web page, it happens when a map context is created (such as in a popup) then the view is disposed of. I believe the solution is to call map.remove() when you are finished with it (i.e. when you close your dialog/page/view)

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

No branches or pull requests

5 participants