Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapLibreGL.addCustomHeader(...) is not a function (it is undefined) #551

Closed
bryanvanwijk opened this issue Dec 10, 2024 · 5 comments
Closed

Comments

@bryanvanwijk
Copy link

Steps to Trigger Behavior

Following the custom HTTP headers docs and then actually adding it triggers an error.

import MapLibreGL from '@maplibre/maplibre-react-native';

MapLibreGL.addCustomHeader("Authorization", "{TOKEN}");

Expected Behavior

The custom header is successfully set and the headers are included on the requests made afterwards.

Actual Behavior

It triggers the following error: _maplibreReactNative.default.addCustomHeader is not a function (it is undefined)

Environment

  • Platform: iOS
  • OS version: iOS 18
  • Device type: iPhone 14
  • Emulator or Simulator: Yes and Physical device as well
  • Development OS: macOS 15.1.1
  • @maplibre/maplibre-react-native Version: 10.0.0-beta.7
  • react-native Version: 0.74.5
  • expo Version: 51.0.34
@tyrauber
Copy link
Collaborator

Huh, I am seeing the native methods, but no, javascript method for addCustomHeader. @KiwiKilian, I same issue as #546, did we accidentally remove the js api for this method?

@KiwiKilian
Copy link
Collaborator

It only ever was a type definition, which seems to have been removed here: 764a3eb#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8L111

@tyrauber
Copy link
Collaborator

Yeah, I am seeing the same thing. I went back through tags all the way to 9.0.0 and it looks like there never was a javascript method?!? In 9.0.0 there was a typescript function declartion, but no js function. I guess this was never implemented?

@KiwiKilian
Copy link
Collaborator

It only needs a passthrough from native, give me 5 minutes.

KiwiKilian added a commit to trafficon/maplibre-react-native that referenced this issue Dec 10, 2024
@tyrauber tyrauber added this to the 10.0.0 milestone Dec 10, 2024
KiwiKilian added a commit that referenced this issue Dec 10, 2024
github-actions bot pushed a commit that referenced this issue Dec 10, 2024
# [10.0.0-beta.8](v10.0.0-beta.7...v10.0.0-beta.8) (2024-12-10)

### Bug Fixes

* export custom header methods ([#552](#552)) ([58abdb0](58abdb0)), closes [#551](#551)
Copy link

🎉 This issue has been resolved in version 10.0.0-beta.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants