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

Unable to resolve module crypto when using 'web3-eth-accounts' #401

Open
Prismoid opened this issue Dec 3, 2022 · 0 comments
Open

Unable to resolve module crypto when using 'web3-eth-accounts' #401

Prismoid opened this issue Dec 3, 2022 · 0 comments

Comments

@Prismoid
Copy link

Prismoid commented Dec 3, 2022

Describe the bug
When importing libraries that use crypto, I see the below error report.
-> Unable to resolve module crypto...
(The detials are shown in https://dev.to/hyetigran/unable-to-resolve-module-crypto-1gek)

To Reproduce
Steps to reproduce the behavior:
In the current working directory,

  1. expo init
  2. npm install --save web3-eth-accounts

App.js

var Accounts = require('web3-eth-accounts');
var accounts = new Accounts('ws://localhost:8546');
accounts.create(); 

Expected behavior
There are no errors.

Screenshots
If applicable, add screenshots to help explain your problem.
The below website shows an example of the error.
https://dev.to/hyetigran/unable-to-resolve-module-crypto-1gek

Desktop (please complete the following information):

  • OS: iOS
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
The below site insists that if you want to avoid this error, you need to eject Expo.
https://dev.to/hyetigran/unable-to-resolve-module-crypto-1gek

But, if there are some solutions, I continue to use Expo.
Thank you.

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

1 participant