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.

Connection issue in React Native

See original GitHub issue

Opened on behalf of @hdvreyes:

I can’t seem to establish a connection unless my debugger is on. Am running on “react-native”: “0.63.4” and “@stomp/stompjs”: “^6.0.0”. ` const client = Stomp.over(function() { return new SockJS(socketUrl); });

client.reconnectDelay = 10000; client.heartbeatIncoming = 5000; client.heartbeatOutgoing = 5000; client.forceBinaryWSFrames = true; client.appendMissingNULLonIncoming = true;

 client.connect(headers, () => {
    client.subscribe(topic, callback, headers);
  });

` Has anyone encountered the same issue? thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kum-deepakcommented, Jan 25, 2021

Usually, it happens because of missing polyfills. This is a peculiar issue, in debug mode, React Native uses a full browser which is not the case in production mode. That causes the list of polyfills to be different in both modes. Please see https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/pollyfils-for-stompjs-v5.html#in-react-native

Few topics related to React Native has been compiled at https://stomp-js.github.io/workaround/stompjs/rx-stomp/ng2-stompjs/react-native-additional-notes.html

Please let me know if it helps.

In addition, Stomp.over and client.connect are v4 syntax and are available as compatibility, i.e., mixing of newer features may not work. Please see https://stomp-js.github.io/#upgrading and https://stomp-js.github.io/#getting-started.

0reactions
kum-deepakcommented, Jan 13, 2022

I am sorry, I am unable to suggest anything more than https://stomp-js.github.io/workaround/stompjs/rx-stomp/ng2-stompjs/react-native-additional-notes.html. Please try the first approach. It may not help, but try adding client.forceBinaryWSFrames = true;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing network connection status in React Native
Effortlessly handle network connection state changes in a React Native app by utilizing NetInfo and Axios for a more resilient product.
Read more >
Troubleshooting - React Native
These are some common issues you may run into while setting up React Native. If you encounter something that is not listed here,...
Read more >
How to Handle Network Connection in Your React Native ...
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 >
Intermittent JavaScript-side connection issues on ... - GitHub
Description We have been observing sporadic extreme network slowness in React Native that occurs on some network requests only on android ...
Read more >
Network connection problem in react native - Stack Overflow
I am trying to run react native app on android using expo cli. But getting this network connection error.network connection problem Image is ......
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