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

Demo version with v4.0.0 is not working on device #72

Open
aorfevre opened this issue Jun 14, 2023 · 4 comments
Open

Demo version with v4.0.0 is not working on device #72

aorfevre opened this issue Jun 14, 2023 · 4 comments

Comments

@aorfevre
Copy link

**PROBLEM **

We are trying web3auth react native and found your demo version.
https://github.com/Web3Auth/web3auth-react-native-sdk/tree/master/demo/rn-expo-example

We tried to use it with the latest version of web3auth-react-native. (v4.0.0) as the package.json is not referring to the latest :
https://github.com/Web3Auth/web3auth-react-native-sdk/blob/master/demo/rn-expo-example/package.json

The version is working fine on iOS Simulator but is not working on iOS / Android Device using expo.
(we did not tried bare workflow and do not intend to eject expo)

Error shown is :
ERROR Error: react-native-quick-crypto is not supported in Expo Go! Use EAS (expo prebuild) or eject to a bare workflow instead., js engine: hermes

We tried to remove react-native-quick-crypto from metro.config.js to react-native-crypto but it triggers other issues.
ERROR TypeError: Cannot read property 'seed' of null, js engine: hermes

** EXPECTED BEHAVIOUR **
A working demo version with v4.0.0 on iOS Simulator & Device.

@aorfevre
Copy link
Author

Demo works fine on iOS Simulator / Device with metro config replaced with :
crypto: require.resolve("crypto-browserify"),

@aorfevre
Copy link
Author

App works with Crypto-browserify for auth and all web3 actions.
However, the logout is not working with that package.

We have :
Error: Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11

So either we use react-native-quick-crypto and we can not use Mobil device.
Or we use crypto-browserify and we can not logout which is annoying for security of the user.

Is there any other packages we can use for crypto injection ?
I have tested also :

  • react-native-crypto and it is not working.

@ryukato
Copy link

ryukato commented Jul 11, 2023

Try this way

  • expo customize webpack.config.js
  • add below to ejected webpack.config.js
    • config.resolve.fallback = { "crypto": require.resolve("crypto-browserify") };

I also tried to customize metro.config.js, and it looks working. Customized metro.config.js is as followings.

config.resolver.disableHierarchicalLookup = false;
config.resolver.extraNodeModules  = {
    crypto: require.resolve("crypto-browserify")
}; 

@ben-passion-xyz
Copy link

Hi @ryukato ,

I'm facing the same issue.
Can you provide the full package.json and metro.config.js?
It would be very helpful, thanks!

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

3 participants