chore(sentry): extend vendor-chunk map filter to cover RangeError (#3156)

The existing beforeSend filter suppresses TypeErrors originating entirely
within maplibre/deck-stack vendor chunks (no first-party frames). Extends
it to also cover RangeError, which appears as "Invalid array length" during
deck.gl vertex-buffer allocation failures on large GL layer updates
(WORLDMONITOR-N4: bindVertexArray / _updateCache in deck-stack chunk).
This commit is contained in:
Elie Habib
2026-04-18 08:15:17 +04:00
committed by GitHub
parent ef3967d991
commit 1732d0554b

View File

@@ -267,9 +267,11 @@ Sentry.init({
if (/this\.style\._layers|reading '_layers'|this\.(light|sky) is null|can't access property "(id|type|setFilter)"[,] ?\w+ is (null|undefined)|can't access property "(id|type)" of null|Cannot read properties of null \(reading '(id|type|setFilter|_layers)'\)|null is not an object \(evaluating '\w{1,3}\.(id|style)|^\w{1,2} is null$/.test(msg)) {
if (frames.some(f => /\/(map|maplibre|deck-stack)-[A-Za-z0-9_-]+\.js/.test(f.filename ?? ''))) return null;
}
// Suppress any TypeError that happens entirely within maplibre or deck.gl internals
// Suppress any TypeError / RangeError that happens entirely within maplibre or deck.gl internals.
// RangeError: "Invalid array length" during deck.gl bindVertexArray / _updateCache on large
// GL layer updates (vertex-buffer allocation failure in vendor code — WORLDMONITOR-N4).
const excType = event.exception?.values?.[0]?.type ?? '';
if ((excType === 'TypeError' || /^TypeError:/.test(msg)) && frames.length > 0) {
if ((excType === 'TypeError' || excType === 'RangeError' || /^(?:TypeError|RangeError):/.test(msg)) && frames.length > 0) {
if (nonInfraFrames.length > 0 && nonInfraFrames.every(f => /\/(map|maplibre|deck-stack)-[A-Za-z0-9_-]+\.js/.test(f.filename ?? ''))) return null;
}
// Suppress Three.js/globe.gl TypeError crashes in main bundle (reading 'type'/'pathType'/'count'/'__globeObjType' on undefined during WebGL traversal/raycast).