Code Monkey home page Code Monkey logo

Comments (12)

robhogan avatar robhogan commented on June 12, 2024 3

Metro maintainer here - thanks @junderw for calling attention to this, it's a known issue on the Metro side. See facebook/metro#815 (comment) for a workaround.

from tiny-secp256k1.

landabaso avatar landabaso commented on June 12, 2024 1

How to replace tiny-secp256k1 with @noble/secp256k1? They have different methods. I want to use it with bitcoinjs-lib

Take a look to this npm package: https://github.com/bitcoinerlab/secp256k1.

from tiny-secp256k1.

junderw avatar junderw commented on June 12, 2024

Probably better to ask this on the metro repo.

from tiny-secp256k1.

niteshbalusu11 avatar niteshbalusu11 commented on June 12, 2024

@Ella-noncelab did you have any luck with this one? I have the same issue.

from tiny-secp256k1.

junderw avatar junderw commented on June 12, 2024

It's probably an issue with hybrid packages.

  1. Node uses a new exports key in package.json to denote the ESM vs. the CJS modules.
  2. Some legacy tools require a main key in package.json to point to CJS.
  3. Your tool probably bundles the ESM but then looks for the main key (CJS) and is probably getting confused.

But I don't know, since I am not the developer of metro

Please ask them.

from tiny-secp256k1.

junderw avatar junderw commented on June 12, 2024

I've gone ahead and reported the issue on your behalf, hopefully a solution will be found.

from tiny-secp256k1.

junderw avatar junderw commented on June 12, 2024

Thanks for the temporary solution and confirmation that the fix is on your radar.

from tiny-secp256k1.

niteshbalusu11 avatar niteshbalusu11 commented on June 12, 2024

Thanks guys! Appreciate the help.

from tiny-secp256k1.

Ella-noncelab avatar Ella-noncelab commented on June 12, 2024

@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

from tiny-secp256k1.

landabaso avatar landabaso commented on June 12, 2024

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).

from tiny-secp256k1.

wookaas avatar wookaas commented on June 12, 2024

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).

How to replace tiny-secp256k1 with @noble/secp256k1? They have different methods. I want to use it with bitcoinjs-lib

from tiny-secp256k1.

crukundo avatar crukundo commented on June 12, 2024

How to replace tiny-secp256k1 with @noble/secp256k1? They have different methods. I want to use it with bitcoinjs-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.

from tiny-secp256k1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.