mixpanel / mixpanel-react-native

Official React Native Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
105 stars 44 forks source link

[Upgrade to v3] : [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. #255

Open christophemenager opened 3 months ago

christophemenager commented 3 months ago

Context

Before (v2)

After (v3)

 ERROR  [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. Please run 'npm install @react-native-async-storage/async-storage' or follow the Mixpanel guide to set up your own Storage class.
 ERROR  [Mixpanel] Falling back to in-memory storage

For now, I keep using 2.4.1 as v3 is not usable.

thoth-seshat commented 2 months ago

I have the exact same setup as @christophemenager in my project and 💯 to his point about the docs, they don't make any sense at all.

Also, in case anyone needs it, here is the MMVK wrapper that SHOULD work when giving your own storage location but doesn't (since using your own storage in React Native breaks this lib). I can't stop stop development to wait for this to get fixed so I'm going to have to fall back. Thanks for heads up to fallback to v2.

Kinda sucks that v3 is broken.

const storage = new MMKV({ id: "mixpanel" });

const MMKVStorageAdapter: MixpanelAsyncStorage = {
  getItem: async (key) => {
    return storage.getString(key) || null;
  },
  setItem: async (key, value) => {
    storage.set(key, value);
  },
  removeItem: async (key) => {
    storage.delete(key);
  },
};
christophemenager commented 2 months ago

Yes @thoth-seshat v3 is broken since several months now, but Mixpanel does not seem to care unfortunately...

zihejia commented 2 months ago

I apologize for the inconvenience and frustration caused by the ongoing issues with v3. We are aware of the problem and are working on it, thank you for your patience and understanding.

christophemenager commented 2 months ago

@zihejia thanks for your answer. Do you have an ETA to fix the v3 release? It has been broken since 6 weeks now :/

christophemenager commented 4 days ago

@zihejia do you have plan to fix this issue? It has been several months since v3 is broken for many users.

its-rav commented 3 days ago

So the expo support in v3 has been broken for months. Does anyone have an alternative lib to integrate with Mixpanel that works with Expo?

christophemenager commented 1 day ago

@its-rav not that I am aware of. I picked mixpanel for analytics because of their react-native integration that sounded great, but I am thinking of switching to Amplitude now