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

MacOS / iOS throw "null is not an object" when using v3

Open rejas opened this issue 1 year ago • 14 comments

We are seeing in our sentry error tool errors popping up since we released a version of our website with maplibre-gl updated from v2 to v3:

React ErrorBoundary Error: null is not an object (evaluating 'e.getParameter(e.VERSION).startsWith')

Unfortunately we cannot reproduce it locally (yet). I will update this issue when we have more information or can reproduce it.

We use maplibre-gl in this library: https://github.com/goodhood-eu/goodhood/tree/master/packages/map

maplibre-gl-js version: 3.3.1

browser: ~~Safari 17, Mobile Safari 17~~ macOS Safari 16+ and iOS Safari 16+ (and browsers on ios that use safari (like firefox)

Steps to Trigger Behavior

  1. ?

rejas avatar Sep 27 '23 15:09 rejas

I'm not sure this code is part of maplibre though...

HarelM avatar Sep 28 '23 12:09 HarelM

I think its this line: https://github.com/maplibre/maplibre-gl-js/blob/d6fdbe449ed8f8195399490c57a2e061ba90bbb7/src/gl/webgl2.ts#L8

rejas avatar Sep 28 '23 12:09 rejas

Here's the stacktrace from sentry report: grafik

rejas avatar Sep 28 '23 12:09 rejas

Hm, interesting. Yes, this was introduced in version 3 as part of the support for webgl 2. Are you using the latest version of maplibre 3? We have added back support for webgl 1 after removing it in the initial version 3 release.

HarelM avatar Sep 28 '23 12:09 HarelM

Yes, we are using the latest └── [email protected] Thing is, it doesnt happen on all safari browsers. Do you know if there's a way to disable webgl on ios/macos? or to block it? which might to lead this parameter being undefined...

rejas avatar Sep 28 '23 13:09 rejas

I think there are ways to disable hardware graphic acceleration (at least I know it can be done in chrome), but then the entire map wouldn't show up anyway. Not sure what's causing this though... :-/

HarelM avatar Sep 28 '23 17:09 HarelM

I've also seen this exact error on iOS/iPadOS 17.0.x. I think it's related to this issue: https://developer.apple.com/forums/thread/737042 I've seen similar issues with other webgl libraries too, such as mapbox, arcgis, unity

Currently as a workaround I've disabled maplibre for users with iOS/iPadOS 17.0.x

handymenny avatar Oct 11 '23 14:10 handymenny

Thanks for the hint @HandyMenny Could be an explanation. Only thing that doesnt fit in our reports are some that say "Mac OS X 10.15.7" as the used OS (along iwth safari 16 and 17 as their browser). Do you know if some ipads use that internally?

rejas avatar Oct 24 '23 05:10 rejas

I think this was fixed by: #3238 Can someone check and close this issue if so?

HarelM avatar Oct 24 '23 05:10 HarelM

Can check once a new version (3.5.2?) is released.

rejas avatar Oct 25 '23 06:10 rejas

Right... my mistake, I thought this was already released...

HarelM avatar Oct 25 '23 07:10 HarelM

Do you have a regular release schedule or when can we expect a new one?

rejas avatar Oct 25 '23 07:10 rejas

We don't have a schedule, if you would like to push things forward you can create a bump version PR, I'll review, approve it and create a new release.

HarelM avatar Oct 25 '23 08:10 HarelM

Created https://github.com/maplibre/maplibre-gl-js/pull/3271 to push things forward.

rejas avatar Oct 25 '23 09:10 rejas