Custom Headers not working with v11 Alpha #955
Replies: 1 comment
-
|
This is a bug, see #1050. |
Beta Was this translation helpful? Give feedback.
0 replies
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-nativev11 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
MLRNCustomHeaderswithout 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
MLRNCustomHeadersis either not exported publicly in v11 alpha, or the API/name changed.Repro steps
@maplibre/[email protected].MLRNCustomHeaderscalls inAppDelegate.swift(as shown above).expo run:ios --device(or via Xcode).What I tried
import MapLibreReactNativeand#if canImport(...)→ symbol not found.pod install/ clean DerivedData.Questions
MLRNCustomHeadersstill the intended API? Has it been renamed/moved?In v10, calling
initHeaders()inAppDelegateensures 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
addCustomHeaderwithout native init, I see early requests hitting my server withoutAuthorization(style/tiles load before JS runs). Initializing headers inAppDelegatesolved that on v10.Environment details (exact versions & config)
package.json
{ "dependencies": { "@maplibre/maplibre-react-native": "^10.2.0", "expo": "53.0.20", "react": "19.0.0", "react-native": "0.79.5", "expo-dev-client": "~5.2.4" },or
{ "dependencies": { "@maplibre/maplibre-react-native": "^11.0.0-alpha.5", "expo": "53.0.20", "react": "19.0.0", "react-native": "0.79.5", "expo-dev-client": "~5.2.4" },app.config.ts
Beta Was this translation helpful? Give feedback.
All reactions