tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
615 stars 112 forks source link

BufferUtil is undefined: bitcore lib #38

Closed seanavery closed 7 years ago

seanavery commented 7 years ago

@mvayngrib I am having trouble "nodeifying" the bitcore library.

You can check out the source code @ https://github.com/SeanAvery/react-native-eth-wallet

After running with --hack --install I am getting an error: BufferUtil.isBuffer is not a function

This makes sense, because the the object does not contain a isBuffer function

screen shot 2017-04-05 at 11 56 48 am

I have tried following the hack described here https://github.com/bitpay/bitcore-lib/issues/108 Also, npm installed buffer and ran rn-nodeify again

The buffer object looks good as such:

screen shot 2017-04-05 at 11 53 35 am

However, I am getting this strange error: Requiring module "21", which threw an exception.

This is seems to be the line where I require buffer...

Is there anything else I can try out? Thank you!

mvayngrib commented 7 years ago

@SeanAvery holy crap am i late to this. Looks like there's a circular dep in bitcore-lib between buffer.js and preconditions.js that the react-native packager doesn't like. This is probably an issue to submit to bitcore-lib or metro-bundler!