Unable to resolve module crypto

Full Error:
Error: undefined Unable to resolve module crypto from /node_modules/@toruslabs/eccrypto/dist/eccrypto.cjs.js: crypto could not be found within the project or in these directories:
node_modules
76 | });
77 |

78 | ;// CONCATENATED MODULE: external “crypto”
| ^
79 | const external_crypto_namespaceObject = require(“crypto”);
80 | var external_crypto_default = /#PURE/webpack_require.n(external_crypto_namespaceObject);
81 | ;// CONCATENATED MODULE: external “elliptic”]


Info

Please provide the Web3Auth initialization and login code snippet below:
const web3auth = new Web3Auth(WebBrowser, {
clientId,
network: OPENLOGIN_NETWORK.TESTNET, // or other networks
});

@yammonabd Thanks for your post.

Your issue has been forwarded to our team and we will get back with further updates once more information becomes available.

1 Like

Facing same issue with using expo and @web3auth/react-native-sdk 4.0.0.
Is there any quick workaround so I wouldn’t be stuck at this point?

Please use the following config as present in our demo:
Metro: https://github.com/Web3Auth/web3auth-react-native-sdk/blob/master/demo/rn-expo-example/metro.config.js
Bare: https://github.com/Web3Auth/web3auth-react-native-sdk/blob/master/demo/rn-bare-example/metro.config.js

1 Like