mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

RangeError: Bad value is thrown on Mac/iOS after updating to 3.10.0

Open BasWagenmaker opened this issue 8 months ago • 3 comments

After updating to 3.10.0 a RangeError: Bad value is occurring. This seems to be happening only on iOS/Mac. The error occurs after having the application open for a while and seems to be related to the loading / refreshing of vector tiles.

Stack trace

RangeError: Bad value
  at decode([native code])
  at <anonymous>(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:31:338233)
  at t(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:31:338379)
  at e.prototypereadFields(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:32:2576)
  at e(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:31:337888)
  at e(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:31:338777)
  at e.prototypereadFields(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:32:2576)
  at Qc(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:31:338877)
  at Nv.loadVTLayers(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:32:209572)
  at bt.updateBuckets(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:36:100247)
  at bt.refreshFeatureState(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:36:100125)
  at Et.initializeTileState(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:36:113469)
  at St._tileLoaded(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:36:118225)
  at Qy.processTask(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:32:157691)
  at Qy.receive(.../../../../common/temp/node_modules/.pnpm/[email protected]/node_modules/mapbox-gl/dist/mapbox-gl.js:32:157532)

mapbox-gl-js version: 3.10+

browser: Safari 18.1+, Chrome Mobile iOS, Mobile Safari, Edge Mobile

Expected Behavior

The map should not crash (when refreshing / reloading tiles) on Mac/iOS

Actual Behavior

The map crashes on iOS/Mac with 3.10.0 and 3.11.0 with a RangeError: Bad value

BasWagenmaker avatar Apr 07 '25 10:04 BasWagenmaker

We're also seeing a similar issue, all on Safari.

Version: 3.5.2

RangeError: Bad value
decode([native code]:)

_f(../../node_modules/mapbox-gl/dist/mapbox-gl.js:31)
define(["exports"],(function(t){var e="3.5.2";let r;const n={API_URL:"https://api.mapbox.com",get...
readFields(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
vf(../../node_modules/mapbox-gl/dist/mapbox-gl.js:31)
define(["exports"],(function(t){var e="3.5.2";let r;const n={API_URL:"https://api.mapbox.com",get...
Mf(../../node_modules/mapbox-gl/dist/mapbox-gl.js:31)
define(["exports"],(function(t){var e="3.5.2";let r;const n={API_URL:"https://api.mapbox.com",get...
readFields(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
[anonymous](../../node_modules/mapbox-gl/dist/mapbox-gl.js:31)
define(["exports"],(function(t){var e="3.5.2";let r;const n={API_URL:"https://api.mapbox.com",get...
Vm.loadVTLayers(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
nx.updateBuckets(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
nx.setFeatureState(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
Rm.initializeTileState(../../node_modules/mapbox-gl/dist/mapbox-gl.js:33)
read:function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for...
Jx._addTile(../../node_modules/mapbox-gl/dist/mapbox-gl.js:40)
 */class px{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=nu...
Jx._updateRetainedTiles(../../node_modules/mapbox-gl/dist/mapbox-gl.js:40)
 */class px{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=nu...
Jx.update(../../node_modules/mapbox-gl/dist/mapbox-gl.js:40)
 */class px{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=nu...
Da.updateSources(../../node_modules/mapbox-gl/dist/mapbox-gl.js:44)
define(["./shared"],(function(e){function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.len...
Map._render(../../node_modules/mapbox-gl/dist/mapbox-gl.js:44)
define(["./shared"],(function(e){function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.len...
Map._triggerFrame(../../node_modules/mapbox-gl/dist/mapbox-gl.js:44)
define(["./shared"],(function(e){function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.len...```

jonathandey avatar May 01 '25 15:05 jonathandey

Thank you for the reports. Seems like our TextDecoder, which we use in pbf faced a WebKit bug described here https://github.com/WebKit/WebKit/pull/43753 at least based on your comments only on iOS/Mac and all on Safari. It was resolved. We can patch pbf to rotate TextDecoder after some time, or we can wait the WebKit fix will be landed (perhaps in Safari 18.5 and already included in TP 218)

cc: @mourner

underoot avatar May 13 '25 15:05 underoot

seems to be related to the loading / refreshing of vector tiles

@BasWagenmaker Do you use some specific custom data source? How often do you refresh data?

underoot avatar May 13 '25 15:05 underoot

seems to be related to the loading / refreshing of vector tiles

@BasWagenmaker Do you use some specific custom data source? How often do you refresh data?

We do use specific data sources, but the problem was also present when just using the newest version of mapbox streets tileset in a custom style from Mapbox Studio. I believe we load the styles once when loading the page. The problem seems only to happen when using styles from Mapbox Studio, and not dynamically added layers / data sources.

BasWagenmaker avatar Aug 05 '25 13:08 BasWagenmaker

@BasWagenmaker Have you encountered this bug recently?

underoot avatar Aug 06 '25 19:08 underoot

@underoot I am still running on version of 3.4.0, which I downgraded to because it did not have this issue. I will bump it to the latest in the coming weeks and see if the error still occurs.

BasWagenmaker avatar Aug 07 '25 10:08 BasWagenmaker

@underoot I've bumped the version to 3.14.0, but we're still seeing the same issue unfortunately.

BasWagenmaker avatar Sep 17 '25 07:09 BasWagenmaker

@BasWagenmaker what is the version of Safari in these reports? Thank you

underoot avatar Sep 17 '25 12:09 underoot

@underoot 18.6 is the newest, also a few still from 18.5

BasWagenmaker avatar Sep 17 '25 12:09 BasWagenmaker