question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to connect and reconnect on react native

See original GitHub issue

I was using this lib for a year and everything is going fine. I was start using RN 0.45, and 0.48 , and then 0.53.0. Everything is perfect.

Until I upgrade to react native 0.53.3, and this issue appear. this is the error I got {"type":"TransportError","description":{"line":"76","collumn":"7944","sourceURL":"index.android.bundle"}} sometimes i got “timeout”

I didn’t change any code, I didn’t change any dependency. What I did just:

  1. Deleting my node_modules folder
  2. In package.json I change RN and react version number.
  3. I run ‘NPM install’

I thought it might the React native issue, so I roll back to the previews version I was used 0.53.0. But this problem still exist. I roll back again to 0.48, the issue still there. and so on.

I use socket.io-client 2.0.3 (I have try 2.0.4 but not help)

  • report a bug
  • request a feature

Setup

  • OS: Windows 10 64bit
  • browser: React Native
  • socket.io version: 2.0.3

I have no Idea what is going on.
Hope someone will help. Thank you

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
skumarcmcommented, Jan 29, 2019

I am having issues in connecting the websocket (socket.io-client, trnasport:[‘websocket’]) on iOS with the webserver. Interestingly, it works when I turn on “Debug JS Remotely” on the device. This might be a problem with the react-native version on iOS. Just curious if someone is facing the same issue.

7reactions
sandropoluancommented, Mar 8, 2018

I resolved this by adding 'transports': ['websocket'], option

  this.socket = openSocket(socketUrl,{
          'reconnection': true,
          'reconnectionDelay': 500,
	  'reconnectionAttempts': Infinity, 
	  'transports': ['websocket'],            
      });

But that option is not required, am I right? So I keep this issue open because it will break when I omitting that option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to React Native development server on ...
Go to Dev Settings → Debug server host for device. Type in your machine's IP address and the port of the local dev...
Read more >
Could not connect to development server : ReactNative
Connection of multiple devices: Enter adb devices command your terminal to a check the list of connected devices. · Run the react server...
Read more >
Managing network connection status in React Native
In this guide, you will learn how to gracefully handle network connection state changes in a React Native app by utilizing NetInfo for ......
Read more >
How to Handle Network Connection in Your React Native App
Your app may need to detect the user's internet connectivity at times. If the user is offline or doesn't have access to a...
Read more >
Reconnect to the media stream - React Native - Sendbird
... to connection issues, the Calls SDK automatically tries to reconnect the participant's media streaming in the room. If the Calls SDK fails...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found