philikon / ReactNativify

How to use node.js libraries in React Native
242 stars 23 forks source link

Can't find variable: Buffer #12

Open arshbot opened 6 years ago

arshbot commented 6 years ago

I followed the steps and followed this issue that was immensely helpful at solving another problem, however now I'm stuck at ironically a similar issue as that previous issue post.

The crypto module seems to import fine, however a standard library file is throwing an error because it can't access Buffer.

image

Any ideas? I'm not sure why this is being thrown now when it didn't happen before.

macashok81 commented 6 years ago

You need to have a global.js file and import it. This is specified in the example. https://github.com/philikon/ReactNativify/blob/master/global.js
https://github.com/philikon/ReactNativify/blob/master/index.android.js