tradle/rn-nodeify

stream-browserify and readable-stream need updated to latest version

yreenchan opened this issue · 4 comments

I recently use react-native-tcp module in my project. It works fine in ios, but it caught errors in android.

error
qq

After I update the modules "stream-browserify" and "readable-stream", It works fine both in ios and android. So I recommend you to update these two packages.

Can confirm, updating stream-browserify and readable-stream fixed this issue for me. For search indexing purposes, the issue is the error Object prototype may only be an Object or null. occurring whenever a module tries to load any dependency using streams, including (in my case) zlib (which is browserify-zlib in react-native).

Something to note when performing this fix:

If you use yarn and run yarn upgrade to install the new versions of stream-browserify and readable-stream, it will overwrite any hacks that rn-nodeify performed. Run rn-nodeify --hack to fix them, but note that running rn-nodeify --install will most likely overwrite the versions of stream-browserify and readable-stream in package.json with the old versions again.

I am experiencing this issue, but only in release builds, not development mode. Also did not seem to happen without react-native-tcp. Nevertheless I still use react-native-udp.

This is the error I am getting_

04-04 10:21:19.482 29137 29206 E ReactNativeJS: Object prototype may only be an Object or null.
04-04 10:21:19.500 29137 29206 E ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)

It happens even if I run yarn upgrade and then rn-nodeify --hack. After the hack, the packager complains about not finding querystring package.

Any valuable insights?

I have same problem, how to fix it? thanks.

yarn compat has been added recently by @jd20, and rn-nodeify will no longer overwrite dependencies unless the --overwrite flag is set. Is anyone still experiencing this issue?