Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
christophemenager opened this issue May 30, 2024 · 10 comments

Comments

@christophemenager
Copy link

Context

  • I am using this lib in a react-native environment (not web)
  • I don't use AsyncStorage but mmkv storage

Before (v2)

  • Everything worked fine, no error

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
  • I don't want to install @RNC/AsyncStorage in my dependencies for this library only
  • Documentation is quite confusing about custom storage or not, async storage or not, web support and could be re-phrased I think

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

@thoth-seshat
Copy link

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
Copy link
Author

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

@zihejia
Copy link
Contributor

zihejia commented Jun 20, 2024

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
Copy link
Author

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

@christophemenager
Copy link
Author

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

@its-rav
Copy link

its-rav commented Sep 10, 2024

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
Copy link
Author

@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

@Kartik4152
Copy link

Any updates on this? We are facing the same issue.

@christophemenager
Copy link
Author

@Kartik4152 nothing new since v3 was released almost 6 months ago. I am still stuck on v2 because of this. @zihejia said they were working on it 5 months ago and they made releases since then, so I hope a fix will come soon.

@christophemenager
Copy link
Author

For info I have moved to a competitor : https://posthog.com/docs/libraries/react-native which has an excellent react-native support, that's what I was looking for when I first chose mixpane,l but I was wrong 🤦

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants