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.

version 2.2 does not work with react native

See original GitHub issue

Reverting to 2.1.1 fixes the problem.

I suspect it has something to do with the new cors management changes. Manually Setting origins does not seem to do anything.

It magically start working when launching the react native debugger.

Config

reconnection: true,
reconnectionDelay: 500,
jsonp: false,
reconnectionAttempts: Infinity,
transports: ['websocket']

Setup

  • OS: iOS
  • browser: react-native
  • socket.io version: 2.2.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:34 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
ajecommented, Sep 6, 2019

Nothing seems like to be working with react native 0.60

3reactions
bensalilijamescommented, Mar 20, 2019

socket.io (unlike the WebSocket API) only accepts a HTTP(S) protocol URI for the client (see the docs here), but it does use the WS protocol behind the scenes.

So if you do io('http://192.168.0.107:8080/endpoint', ...) it should work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading to new versions - React Native
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies.
Read more >
React native fetch api does not work with localhost, IP, or even ...
I'm using my mobile device. I tried 127.0.0.1. That didn't work and also I used postman to verify that I'm getting the correct...
Read more >
Installation | React Native Reanimated - Software Mansion
Reanimated 2 is primarily built in C++ using Turbo Modules infrastructure which is not yet completely deployed in React Native (specifically on Android)....
Read more >
@react-native-picker/picker - npm
React Native Picker for iOS, Android, macOS, and Windows. Latest version: 2.4.8, last published: 2 months ago.
Read more >
Introducing Hooks - React
React 16.8.0 is the first release to support Hooks. When upgrading, don't forget to update all packages, including React DOM. React Native has...
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