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

Can't find module bcrypto when using in browser #1079

Open
michalsmiarowski opened this issue Aug 11, 2022 · 3 comments
Open

Can't find module bcrypto when using in browser #1079

michalsmiarowski opened this issue Aug 11, 2022 · 3 comments

Comments

@michalsmiarowski
Copy link

michalsmiarowski commented Aug 11, 2022

When the lib is used in the browser, with react on the front-end, this error occurs - Can't find module "bcrypto".

Error stacktrace image

As you can see from the stracktrace we are importing const bech32m = require('bcrypto/lib/encoding/bech32m'); in the bcoin/lib/primitives/address.js file and it's using the bech32m file instead of bench32m-browser file, because it is not mapped in browser property in bcrypto package.json file. I created the issue for the bcrypto lib as well - bcoin-org/bcrypto#66

Here is also related resolved issue but the problem still persist when using the lib in the browser - #1070

@pinheadmz
Copy link
Member

wasn't this just fixed on master? #1071

@pinheadmz
Copy link
Member

ok I see, this will be fixed in bcrypto then

@michalsmiarowski
Copy link
Author

michalsmiarowski commented Aug 12, 2022

The PR in bcrypto is ready for review - bcoin-org/bcrypto#67

But I think we also have to update the bcrypto lib in node_modules directory in this project (bcoin)

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

2 participants