-
-
Notifications
You must be signed in to change notification settings - Fork 883
fix: prevent clearFadeHold undefined error #5874
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for taking the time to open this PR. |
This is the stacktrace, if that can help you help me figure out how to write a test here
|
Can you reproduce the issue with maplibre only? Without any wrapper? Doing this will help define the relevant test... |
Disassembling our wrapper logic while preserving the control logic that led to this issue enough to make a reproduction would take a significant amount of time for us. I am quite the beginner in maplibre, but I just subscribed to repo updates. I am a bit more experienced in the vis.gl side of things. I can keep this in mind as I learn more but short term I cannot be of much value. Its fair to say that this conditional operator doesnt manipulating the behavior of this in any negative way. So could we see this merged and add the bug as an issue or point of discussion instead? |
I prefer to have a better understanding of the issue, it might be that this is not the right place to fix it but rather in a different place where it makes more sense. |
@HarelM this error is resolved when removing the terrain source config, but again, this libary is too nested to provide a reproduction at this moment, so I will reach out to the wrappers' developers to see what insights they may be able to provide. const MAP_STYLE: StyleSpecification = {
version: 8,
projection: {
type: "globe",
},
sources: {
satellite: {
url: "https://api.maptiler.com/tiles/satellite-v2/tiles.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL",
type: "raster",
},
terrainSource: {
type: "raster-dem",
url: "https://api.maptiler.com/tiles/terrain-rgb/tiles.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL",
tileSize: 256,
},
},
layers: [
{
id: "Satellite",
type: "raster",
source: "satellite",
},
],
sky: {
"atmosphere-blend": [
"interpolate",
["linear"],
["zoom"],
0,
1,
5,
1,
10,
0.5,
15,
0.2,
],
},
//FIXME: Error: Cannot read properties of undefined (reading 'clearFadeHold') when using terrain, removing this prevents the error from throwing.
terrain: {
source: "terrainSource",
exaggeration: 1,
},
}; |
FYI: I've been seeing these crashes as well in a completely different context (Angular + MapBox Draw), so it's definitely not related to the specific wrapper. The crash is able to stall the map instance for good because there is no error cleanup in the render task queue. If any function in the task queue throws, it gets stuck in the "running" state indefinitely and rejects any subsequent calls to I don't think this is the right place to fix it though - adding error handling to the render task queue will probably impact performance massively, and render tasks should not be expected to error out. It is, however, a good place for a workaround - I'm currently probing for the crashed/stuck/stalled state after enabling terrain and overriding the task queue state if the probe fails: requestAnimationFrame(() => {
try {
map._render(Date.now())
} catch {
map._renderTaskQueue._currentlyRunning = false
map._render(Date.now())
}
}) I'm still investigating if/how I can minimally reproduce the |
Managed to reproduce it semi-reliably - here's a slightly modified version of the The issue happens during motion, especially zooming. From time to time, there's a single tile kept in |
@viernullvier thanks for looking into this! |
This issue resolves an issue where Maplibre crashes due to a crash throwing
cannot read undefined: clearFadeHold
when Maplibre is being controlled by DeckGL and animated with HubbleGL.The error does not occur repeatably, but it occurs enough to be an issue for end users that cannot be avoided.
Debugging to the root cause is unrealistic for us since our API with Maplibre is abstracted quite significantly by using
react-map-gl/maplibre
and delegating the control of the viewState toDeckGL
&HubbleGl
.Happy to learn more here...
Launch Checklist
CHANGELOG.md
under the## main
section.