Closed Ella-noncelab closed 2 years ago
Probably better to ask this on the metro repo.
@Ella-noncelab did you have any luck with this one? I have the same issue.
It's probably an issue with hybrid packages.
But I don't know, since I am not the developer of metro
Please ask them.
I've gone ahead and reported the issue on your behalf, hopefully a solution will be found.
Metro maintainer here - thanks @junderw for calling attention to this, it's a known issue on the Metro side. See https://github.com/facebook/metro/issues/815#issuecomment-1117607661 for a workaround.
Thanks for the temporary solution and confirmation that the fix is on your radar.
Thanks guys! Appreciate the help.
@Ella-noncelab did you have any luck with this one? I have the same issue.
Sorry.. I just gave up to use this. Because I only have to get addresses and keys so I use 'hdkey' package instead. https://www.npmjs.com/package/hdkey
Anyway guys, be aware that tiny-secp256k1
uses WASM which is not supported by react-native Javascript Core engine (iOS / Android). It does work on react-native-web though. Note that Android emulator may run WASM but it will not run on the actual device.
You can use the older version tiny-secp256k1@1
(which is quite slow on devices but does the job) or @noble/secp256k1
which is super fast (order-of-magnitude comparable to WASM) and works together just fine with bitcoinjs-lib.
One last thing. One problem with @noble/secp256k1
is that it is based on BigInt
, which is only supported in React-Native by iOS
right now, but will also join Android in the upcoming RN-0.70
release (using the new Hermes Js engine).
Anyway guys, be aware that
tiny-secp256k1
uses WASM which is not supported by react-native Javascript Core engine (iOS / Android). It does work on react-native-web though. Note that Android emulator may run WASM but it will not run on the actual device.You can use the older version
tiny-secp256k1@1
(which is quite slow on devices but does the job) or@noble/secp256k1
which is super fast (order-of-magnitude comparable to WASM) and works together just fine with bitcoinjs-lib.One last thing. One problem with
@noble/secp256k1
is that it is based onBigInt
, which is only supported in React-Native byiOS
right now, but will also join Android in the upcomingRN-0.70
release (using the new Hermes Js engine).
How to replace tiny-secp256k1
with @noble/secp256k1
? They have different methods. I want to use it with bitcoinjs-lib
How to replace
tiny-secp256k1
with@noble/secp256k1
? They have different methods. I want to use it withbitcoinjs-lib
Take a look to this npm package: https://github.com/bitcoinerlab/secp256k1.
How to replace
tiny-secp256k1
with@noble/secp256k1
? They have different methods. I want to use it withbitcoinjs-lib
Take a look to this npm package: https://github.com/bitcoinerlab/secp256k1.
This helped. If you are running RN >0.70 with Hermes, this might unblock you.
This is the code snippet I used tiny-secp256k1
When I run this app, below error occurred.
error: Error: While trying to resolve module
tiny-secp256k1
from file/Users/eunjilim/AssetController.ts
, the package/Users/app/node_modules/tiny-secp256k1/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/Users/app/node_modules/tiny-secp256k1/lib/cjs/index.cjs
. Indeed, none of these files exist:and when try to run application this warning show up