Hi Mappedin team,
We're seeing an intermittent error when initializing MapView with
@mappedin/react-native-sdk 6.21.1 (React Native 0.85, Hermes):
Invalid token specified: invalid base64 for part #2
The root cause seems to be that the SDK's bundled jwt-decode relies on the
global `atob`, and Hermes' implementation is stricter than browsers about
padding (see https://github.com/facebook/hermes/issues/1379) — so only some
tokens fail, which explains the intermittency.
For now we're working around it by overriding the global `atob`/`btoa` with a
forgiving implementation, but it would be great to have this fixed in the SDK
itself (e.g. normalizing/padding before decoding).
Happy to provide logs or more details if useful. Thanks!
Thank you for this report. We’ll fix this. Until then, I recommend to continue with the workaround you found.
To help validate the fix, could you send me the map ID you were seeing this on? This will help narrow down where to best fix this.
I haven’t been able to reproduce this. Are you able to capture a token that failed and send it to me via private message?