diff --git a/plugin-designs/doxa-simple-map/doxa-simple-map.vue b/plugin-designs/doxa-simple-map/doxa-simple-map.vue index d1550b350..70f271b3c 100644 --- a/plugin-designs/doxa-simple-map/doxa-simple-map.vue +++ b/plugin-designs/doxa-simple-map/doxa-simple-map.vue @@ -1356,9 +1356,18 @@ onMounted(async () => { }) // 2. Initialize map (returns before 'load' fires) + // ★ A PANE RELEASED WHILE ITS MAP IS STILL STARTING IS A CANCEL, NOT A FAILURE. This map is a heavy + // gallery tab: switching away empties its slot. initializeMap then returns SILENTLY (useMapInstance's + // liveness checks) and leaves map.value null, which this reported as "Map failed to initialize — + // check token and container": a console ERROR blaming the token for a tab switch (measured + // 2026-09-29, a phone in Arabic, switched away 150 and 500 ms in: 2 runs in 10; 0 when the map was + // left to start). Nobody is waiting for this map any more, so return quietly. A mounted pane that + // really fails still logs. + const released = () => !mapContainer.value || !mapContainer.value.isConnected try { await initializeMap() } catch (err) { + if (released()) return // `new mapboxgl.Map()` throws outright when the device has no WebGL context. console.error('[doxa-simple-map] Map failed to initialize —', err) mapError.value = String(err?.message || err) @@ -1367,6 +1376,7 @@ onMounted(async () => { unwrapMap() if (!map.value) { + if (released()) return console.error('[doxa-simple-map] Map failed to initialize — check token and container') mapError.value = t('simpleMap.initFailed') return