segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
360 stars 185 forks source link

TypeError: Cannot read property 'PluginError' of undefined #828

Closed adamhari closed 1 year ago

adamhari commented 1 year ago

Updated @segment/analytics-react-native-plugin-firebase from 0.3.4 to 0.3.9 and I am now getting this error when I call Segment functions. My @react-native-firebase deps are at 17.4.3.

Usage:

const segmentClient = createClient({
  writeKey: writeKey,
  debug: debug,
  trackAppLifecycleEvents: false,
});

segmentClient.add({ plugin: new FirebasePlugin() });

segmentClient.track('event', {});

Steps to reproduce

Call track on the analytics instance.

Expected behavior No errors.

Actual behavior TypeError: Cannot read property 'PluginError' of undefined

image
adamhari commented 1 year ago

The issue was I had multiple versions of @segment/analytics-react-native (2.8.0 and 2.14.0) in my dependency tree