Select to view content in your preferred language

Too many active WebGL contexts. Oldest context will be lost.

596
6
04-10-2024 04:40 AM
SaurabhUpadhyaya
Occasional Contributor

Hi,

In our application, we are utilizing approximately 8 feature layers through FeatureLayer.

We dynamically generate renderers based on definition expressions on these feature layers. However, we are encountering a serious WebGL error: "Too many active WebGL contexts. Oldest context will be lost." This error occurs when we rapidly zoom in/out and load the map based on the selected dropdown list (definition expressions). we dynamically apply definition expressions on feature layers.

SaurabhUpadhyaya_0-1712749202203.png

 

SaurabhUpadhyaya_1-1712749202668.png

 

 

As a result of this error, the map displays as blank, and all added layers are removed. It's worth noting that in the blank map, the search and zoom in/out controls are still visible, but the layers are not showing.

SaurabhUpadhyaya_2-1712749201755.png

 

We would greatly appreciate any suggestions or guidance on how to resolve this issue.

Thank you.

6 Replies
SamEngel
New Contributor II

Hi @SaurabhUpadhyaya ! It's hard to tell what might be going on without looking at the code. Are you able to reproduce the issue in a simple isolated app and share it in a codepen or something similar?

Some general info: this kind of error might appear if you are creating multiple MapViews or SceneViews. And sometimes this can happen accidentally when using a framework like React, where it's possible for the view to get recreated in an effect/signal. Is any of that relevant to your use case?

0 Kudos
SaurabhUpadhyaya
Occasional Contributor

Hi, 

I am working on react application, where we have 2 mapviews (ArcGIS JS API 4.29) for side by side compare data to verify the changes. 

Case:

In Left Map data is already loaded, and for right map loading the data on selection of dropdown list and initial 5-6 selection and applying on map, it is working perfect after that some times left map went blank(loaded layers not displaying) and sometimes rightmap went blank.. even i am loading data only on right side map.

When i check on console its shows the warning

SaurabhUpadhyaya_0-1712896655352.png

Can anyone share to resolve this issue.

@AnneFitz 

@JoelBennett 

@AndyGup 

@Sage_Wall  

 

0 Kudos
ReneRubalcava
Frequent Contributor II

Please provide a github repo, stackblitz, or codesandbox that reproduces this issue. As Sam pointed out, no way to pinpoint the problem without it.

SaurabhUpadhyaya
Occasional Contributor

Hi friend's,

can you please share some work around to resolve this issue.

0 Kudos
KarinaLivingston
Occasional Contributor

This is happening to me too. 

 

0 Kudos
SamEngel
New Contributor II

Hey! We'd love to get this cleared up. There's not much we can do without a repro, but another piece of information that could be helpful is if this behavior only started after upgrading the version of the SDK you use. Did anyone experience something like that? Alternatively, is the issue still present in older versions of the SDK, like 4.28?