davide-scalzo / react-native-mixpanel

A React Native wrapper for Mixpanel tracking
MIT License
455 stars 195 forks source link

Null Reference used for synchronization #193

Open ariniastari opened 4 years ago

ariniastari commented 4 years ago

This error has been come up on my development on android Screenshot_2019-09-18-16-22-36-98_233f7b86106e68c480f88fc37b8473e2

implementation

      const mixpanel = new MixpanelInstance(REACT_APP_MIXPANEL_ID);
      mixpanel.initialize().then(() => {
        mixpanel.track(currentScreen);
      });
lucasgerard commented 3 years ago

In my case this was caused by passing an undefined token to Mixpanel.sharedInstanceWithToken.

if you're using react-native-config: please check that you've followed this extra step, otherwise your Config values will be undefined.