Edwin
Edwin•3y ago

React Native

Hi! My friend is trying to set up Convex with React Native Expo and he came across this error. Wondering if Convex isn't compatible with Expo? Or could there be something he missed out?
No description
3 Replies
sshader
sshader•3y ago
FWIW I had trouble getting Expo to work with Convex when I tried a few months ago (but without Expo was fine) so would love to hear back if y'all got it working
Edwin
EdwinOP•3y ago
Hi! Yeah, at the moment he got it working by importing react-native-get-random-values in App.tsx instead of index.js. If anything new comes up, I'll let you know! Hi! Just wanted to drop an update about this. So, we came across another error while trying to run our Expo app on Android. It ran fine on iOS, but on Android it had an issue with BigInt. I think Convex has a dependency (crypto?) that uses BigInt, which isn't supported by React Native? So I had to install the big-integer package and make the dependency use that instead of BigInt. To do that, I had to use rn-nodeify which basically installs 'shims' for core node modules (https://github.com/tradle/rn-nodeify), then globally substitute BigInt with big-integer in the shim.js file (https://github.com/facebook/react-native/issues/28492#issuecomment-824698934). After that, everything seems to be working perfectly!
sshader
sshader•3y ago
Ooh thanks for the update (I will admit I did most of my own testing with iOS). I'll look into it! 🙂

Did you find this page helpful?