Skip to content

Promote to production: fix map-explorer stack overflow on resize - #165

Merged
slaveofcode merged 2 commits into
mainfrom
develop
Aug 7, 2026
Merged

Promote to production: fix map-explorer stack overflow on resize#165
slaveofcode merged 2 commits into
mainfrom
develop

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Promotes fix/map-explorer-resize-stack-overflow (PR #164) to production.

Kresna and others added 2 commits August 7, 2026 15:51
The previous fix called map.resize() synchronously inside the moveend
handler. MapLibre internally calls constrainInternal during resize, which
fires another moveend within the same call stack → infinite recursion →
RangeError: Maximum call stack size exceeded.

Fix: guard flag + requestAnimationFrame so resize() runs after the current
call stack clears. The flag ensures at most one pending resize at a time,
and rAF breaks the synchronous recursion path entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…k-overflow

fix(maps): stack overflow from map.resize() inside moveend handler
@slaveofcode
slaveofcode merged commit afb2a2f into main Aug 7, 2026
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant