rnmapbox / rnmapbox/maps

[Bug]: TypeError: _NativeRNMBXChangeLineOffsetsSha(...)eAnimatorModule.default.generate is not a function (it is undefined)

Open
#4,059 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug 🪲
Dominant language
Kotlin
Stars
2.9k
Forks
947
Avg merge
6d 37m
Merged PRs (30d)
1

Description

Mapbox Implementation

Mapbox

Mapbox Version

11.15.2

React Native Version

0.77.3

React Native Architecture

New Architecture (Fabric/TurboModules)

Platform

iOS

@rnmapbox/maps version

10.2.6

Standalone component to reproduce
// ⚠️ NOT directly reproducible, example only.
// Crash happens in production when using experimental animators.

import React from 'react';
import Mapbox, {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
  __experimental
} from '@rnmapbox/maps';

const line = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

export default function BugReportExample() {
  // Example of using animators involved in crashes:
  const moveAnimator = new __experimental.MovePointShapeAnimator([-74.00597, 40.71427]);
  const offsetAnimator = new __experimental.ChangeLineOffsetsShapeAnimator({
    coordinates: line.coordinates,
    startOffset: 0,
    endOffset: 0,
  });

  // In production, we call moveTo()/setEndOffset() repeatedly during animation

  return (
    <MapView style={{flex: 1}}>
      <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
      <ShapeSource id="line-source" shape={offsetAnimator}>
        <LineLayer id="line-layer" />
      </ShapeSource>
      <ShapeSource id="point-source" shape={moveAnimator} />
    </MapView>
  );
}
Observed behavior and steps to reproduce

When using the new architecture on React Native 0.77.3, calling new __experimental.ChangeLineOffsetsShapeAnimator(...) throws the following error:

Image
Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the __experimental.ChangeLineOffsetsShapeAnimator constructor and the moveTo()/setEndOffset() calls described in the report, using React Native 0.77.3 on iOS with the New Architecture enabled. Inspect how these animator entry points connect to the native module and reproduce the undefined generate error; done means the animator can be constructed and repeatedly updated without throwing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.