question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native bitcoinjs install issues

See original GitHub issue

I’m trying to implement bitcoinjs-lib in react-native, but I get errors when it looks for Buffer and other crypto libraries. I have used rn-nodeify as referenced in #582 and #797 and imported the shim but it’s still complaining. My install process to include bitcoinjs-lib/bip39 is as follows:

npm install --save bitcoinjs-lib bip39 react-native-crypto npm install (at this point the post-install does rn-nodeify --install fs,dgram,process,path,console --hack) react-native start and react-native run-android for my emulator

react-native is still complaining about stream, and once I include stream it complains about buffer/safe-buffer/cipher-base and once I include any of those and rebuild it gives the infamous “Can’t find variable Buffer”

I’ve read around that others have got it to work but have yet to be able to build it myself. Any pointers in the install process?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:56 (27 by maintainers)

github_iconTop GitHub Comments

12reactions
harunsmrkoviccommented, Nov 8, 2018

If you are experiencing issues with this library working fine in Simulator/Debug mode, but not working when preparing for release, you need to disable mangle from uglify.

No need to patch anything though, just add the following to your metro.config.js file:

module.exports = {
  transformer: {
    minifierConfig: {
      mangle: {
        keep_fnames: true
      }
    }
  }
}

🎉

11reactions
dcousenscommented, Jan 18, 2018

@wmpedersen it may seem like no one is listening, but I guarantee any information you post about the problems you’re having will help someone in the future, so please post the details 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-bitcoinjs-lib - npm
Start using react-native-bitcoinjs-lib in your project by running `npm i ... Install rn-nodeify to be able to use Node.js libs.
Read more >
react-native-bitcoinjs - npm Package Health Analysis - Snyk
You can connect your project's repository to Snyk to stay up to date on security alerts and receive automatic fix pull requests. #...
Read more >
bitcoinjs - Bountysource
I'm trying to implement bitcoinjs-lib in react-native, but I get errors when it looks for ... npm install --save bitcoinjs-lib bip39 react-native-crypto
Read more >
Importing 'bitcoinjs-lib' into a react app causing: Error: Can't resolve ...
I'm building a react native app and am trying to import the bitcoinjs-lib but whenever I do, it immediately crashes with the error...
Read more >
rn-nodeify/readme.md - UNPKG
3, Run after npm install and you can use node core modules and npm modules ... run `react-native link` after installing new shims...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found