I am new to web3Auth , expo and react native. In order to create a PoC i used expo cli to create a new react native project. I then installed all the required librarier usin npm and created the required android folder using npx expo prebuild. I copied over the code from React native expo example from github and ran it using npm run android. I changed the client id to my client id and changed network to saphiredev . The app runs but when i click login using email : i get the following error: cannot read property 'digest' of undefined
can any one please guide what i might be missing or doing wrong ?
Hi Ayush:
I am using the latest â@web3auth/react-native-sdkâ: â^7.0.0â . I think every single sdk or library is on its latest version. I copied the globals.js and metro.config.js from the example react native expor project. Should that not have added polyfils?
I understand youâre facing this issue upon login. Could you please confirm whether youâre using the metro config as outlined in this migration guide here? We recently made some tweaks to the recommended metro configurations.
Let me know if this helps or if you need further assistance.
Hey maharshi,
changing the metro.config.js to the one outlined in the migration guide works.
However, the migration guide is a bit confusing. It refers to changing index.ts and globals.ts for expo based workflows. If you created the app by following the example expo project on your github here as i did, then you do not have globals.ts and index.ts. I know a normal expo router will have a index.ts so i can imagine that is the index.ts referred to in this guide. However, globals.ts update starts with import â./globalsâ; which is a little confusing.
Thank you for your help. In my case just changing metro.config.js was enough to get rid of the error. However, please double check the migration guide as it is a bit confusing for expo based workflows.
regards
Rameez