Skip to content

Object prototype may only be an Object or null! #42

Closed
@omidnavy

Description

@omidnavy

Hi

I'm working on a project which needs tcp socket , and when i tried to use this library , i get the error mentioned in the title ! I know its a stream /rn-nodeify error , but while its a dependency of native-tcp , I posted this issue here , is there anything i can do to fix this one ?
react-native @0.41.2
react-native-net @3.2.1
rn-nodeify @7.0.1

screenshot_2017-02-26-11-16-05

Activity

ArcanoxDragon

ArcanoxDragon commented on Mar 30, 2017

@ArcanoxDragon

I'm getting this when trying to nodeify zlib for react-native as well. I haven't been able to find any information anywhere on this issue.

ArcanoxDragon

ArcanoxDragon commented on Mar 30, 2017

@ArcanoxDragon

I found a temporary workaround for this issue here.

nisargrthakkar

nisargrthakkar commented on May 3, 2017

@nisargrthakkar

Hello @omidnavi @briman0094
I have also faced this error, after some workaround, I tried below steps and worked for me. Please check if this can help you as well.

  1. Latest RN setup. (react-native init project_name)
  2. npm install react-native-tcp@3.1.0 --save (and other command as specified, only thing is to use 3.1.0 version )
  3. update string-browserify and readable-stream to latest version
  4. Manually add stream module to node_modules.
zelll

zelll commented on May 19, 2017

@zelll

Try this:

npm install react-native-tcp@3.2.1 --save
npm install --save-dev rn-nodeify
node_modules/.bin/rn-nodeify --install stream,process,util --hack
npm install readable-stream@2.2.8 stream-browserify@2.0.1 --save

viethaca

viethaca commented on Jun 20, 2017

@viethaca

@zelll it's worked for me when run debug.
When run release android, app has crashed

scriptfans

scriptfans commented on Aug 30, 2017

@scriptfans

same problem, how to fix it? thanks.

omidnavy

omidnavy commented on Aug 30, 2017

@omidnavy
Author

@scriptfans check this answer :

Latest RN setup. (react-native init project_name)
npm install react-native-tcp@3.1.0 --save (and other command as specified, only thing is to use 3.1.0 version )
update string-browserify and readable-stream to latest version
Manually add stream module to node_modules.

if didnt work , check this one:

npm install react-native-tcp@3.2.1 --save
npm install --save-dev rn-nodeify
node_modules/.bin/rn-nodeify --install stream,process,util --hack
npm install readable-stream@2.2.8 stream-browserify@2.0.1 --save

scriptfans

scriptfans commented on Aug 31, 2017

@scriptfans

@omidnavi Thanks very much. I solved it in another way, we can install the github version rn-nodeify to fix it:
"devDependencies": { "rn-nodeify": "mvayngrib/rn-nodeify" }

shiyunsheng

shiyunsheng commented on Jan 18, 2018

@shiyunsheng

@viethaca please help me
it's worked for me when run debug.
When run release android, app has crashed
How did you solve it?

shiyunsheng

shiyunsheng commented on Jan 18, 2018

@shiyunsheng

use the latest version .it's ok
npm install react-native-tcp --save
npm install --save rn-nodeify (no dev)
node_modules/.bin/rn-nodeify --install stream,process,util --hack
npm install readable-stream stream-browserify --save

viethaca

viethaca commented on Jan 18, 2018

@viethaca

@shiyunsheng i use rn 0.48.4 and react-native-tcp 3.3.0 and in package.json add

"scripts":{
"postinstall": "rn-nodeify --install stream,process,util --hack",
}

uriva

uriva commented on Jun 28, 2018

@uriva

All the above not working for me. RN 0.55.4

shiyunsheng

shiyunsheng commented on Jul 7, 2018

@shiyunsheng

@uriva use npm install readable-stream@2.2.8 stream-browserify@2.0.1 --save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @scriptfans@ArcanoxDragon@uriva@zelll@shiyunsheng

        Issue actions

          Object prototype may only be an Object or null! · Issue #42 · PeelTechnologies/react-native-tcp