tradle/rn-nodeify

Streams not working

Closed this issue · 1 comments

I need to use this SDK: https://github.com/BitGo/BitGoJS with a react native app. My idea was to use your package to replace node core dependencies like streams and buffers with their client counterparts so the SDK could run on react native. I've cloned that repo, ran rn-nodeify --install --hack, required shim.js at index.js and imported that index.js from a module in my app. But when I try to run it on a device I get error:

Object prototype may only be an Object or null.
inherits
inherits_browser.js:5
<unknown>
_stream_readable.js:52
...

As you can see it's unable to inherit readable stream from stream. If I add console.log to _stream_readable.js I see that after it does var Stream = require('stream') variable Stream holds an empty object {} and it's prototype is undefined so it fails to inherit.
How can I fix this behavior and what is its reason?