MLRNCustomHeaders works on v10.2.0 but fails on v11 alpha (new architecture + Hermes, Expo dev client #955
Unanswered
victorcg03
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I’m migrating an app to
@maplibre/maplibre-react-native
v11 alpha to benefit from better New Architecture support (Fabric + Hermes).With v10.2.0 I can inject custom HTTP headers for vector tile/style requests using
MLRNCustomHeaders
without any issues.On v11 alpha the same approach fails at build time on iOS.
Environment (high level):
prebuild
+expo run:ios
)newArchEnabled: true
,jsEngine: "hermes"
)@maplibre/maplibre-react-native
: v10.2.0 (works) → v11.0.0-alpha.x (fails)What works on v10.2.0
AppDelegate.swift
Bridging header
JS (later, when I have the token)
✅ This reliably sends headers to my tile/style backend (verified in server logs).
What fails on v11 alpha
If I keep the same code and just bump to v11 alpha:
or
I get:
I get:
So it looks like
MLRNCustomHeaders
is either not exported publicly in v11 alpha, or the API/name changed.Repro steps
@maplibre/maplibre-react-native@11.0.0-alpha.x
.MLRNCustomHeaders
calls inAppDelegate.swift
(as shown above).expo run:ios --device
(or via Xcode).What I tried
import MapLibreReactNative
and#if canImport(...)
→ symbol not found.pod install
/ clean DerivedData.Questions
MLRNCustomHeaders
still the intended API? Has it been renamed/moved?In v10, calling
initHeaders()
inAppDelegate
ensures some early requests (style/tiles) also include headers before JS callsaddCustomHeader
. What’s the equivalent in v11 alpha?<MapView/>
mounts)?Any guidance or pointer to the right header/module/API in v11 alpha would be super helpful.
Thanks a lot!
Extra (server logs showing missing headers without native init)
When relying only on JS
addCustomHeader
without native init, I see early requests hitting my server withoutAuthorization
(style/tiles load before JS runs). Initializing headers inAppDelegate
solved that on v10.Environment details (exact versions & config)
package.json
or
app.config.ts
Beta Was this translation helpful? Give feedback.
All reactions