maplibre-react-native icon indicating copy to clipboard operation
maplibre-react-native copied to clipboard

MarkerView Crashes App with _helpers.point is not a function (@turf/helpers)

Open AntonellaAnzil opened this issue 7 months ago • 1 comments
trafficstars

Describe and reproduce the Bug

🐛 Bug Report

Steps to Reproduce

1.- Install MapLibre React Native in an Expo app:

npx expo install @maplibre/maplibre-react-native

2.- Add the plugin to the plugins array in app.config.js.

3.- Modify the iOS Podfile, adding the following to the post_install block:

$MLRN.post_install(installer)

4.- Rebuild the app:

npx expo run:ios

5.- Add a basic MarkerView to the map, using the MarkerView component to render a marker.

6.- Observe the error on app launch.

Expected Behavior

The MarkerView component should render correctly on the map without throwing any runtime errors.

Actual Behavior

The app crashes with the following error when rendering the MarkerView component:

TypeError: _helpers.point is not a function (it is undefined)

Upon inspecting the MarkerView.js file inside node_modules, I found that it imports point from @turf/helpers like this:

var _helpers = require("@turf/helpers");

However, logging _helpers returns the number 46 instead of the expected object containing functions like point. This suggests the module is being imported incorrectly or something is interfering with the resolution of @turf/helpers.

Reproducible Demo

A minimal project that reproduces this issue can be provided upon request.

Environment

Expo SDK version: 51.0.24

React Native version: 0.74.3

MapLibre React Native version: 10.1.4

Plugin: @maplibre/maplibre-react-native

Node.js version: 18.18.0

Platform: iOS

If there’s anything I can do to help debug or if you need any additional information, I’d be happy to provide it. Thanks in advance for your support, and thank you for the great work on this library!

@maplibre/maplibre-react-native Version

10.1.4

Which platforms does this occur on?

iOS Simulator

Which frameworks does this occur on?

Expo

Which architectures does this occur on?

No response

Environment

expo-env-info 1.2.2 environment info:
    System:
      OS: macOS 15.1.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node
      npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm
      Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.2, iOS 18.2, macOS 15.2, tvOS 18.2, visionOS 2.2, watchOS 11.2
    IDEs:
      Android Studio: 2023.3 AI-233.14808.21.2331.11709847
      Xcode: 16.2/16C5032a - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ~19.0.1 => 19.0.1
      expo: ^51.0.24 => 51.0.24
      expo-router: 3.5.14 => 3.5.14
      metro: 0.80.9 => 0.80.9
      react: 18.2.0 => 18.2.0
      react-dom: 18.2.0 => 18.2.0
      react-native: 0.74.3 => 0.74.3
      react-native-web: ~0.19.10 => 0.19.12
    npmGlobalPackages:
      eas-cli: 12.4.1
    Expo Workflow: bare

AntonellaAnzil avatar Apr 10 '25 09:04 AntonellaAnzil

Thanks for the report. Could you provide a reproduction repository?

KiwiKilian avatar Apr 13 '25 16:04 KiwiKilian

Closing due to missing feedback. Happe to reopen, once more info is available.

KiwiKilian avatar May 13 '25 02:05 KiwiKilian