react-native bitcoinjs install issues
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:7
- Comments:56 (27 by maintainers)
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
fromuglify
.No need to patch anything though, just add the following to your
metro.config.js
file:🎉
@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 👍