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.

infinite XHR calls from sockjs-node when using HTTPS

See original GitHub issue

Is this a bug report?

Yes it is.

Did you try recovering your dependencies?

Yes I did

npm --version : 5.4.0 yarn --version 1.3.2

Which terms did you search for in User Guide?

I have searched for ‘HTTPS’ and ‘sockjs-node’ in the docs.

Environment

node -v : v9.4.0 npm -v : 5.6.0 yarn --version: 1.3.2 I have ejected, webpack version is 3.8.1

OS : macOS High Sierra 10.13.2 browser : latest chrome or firefox

Steps to Reproduce

for now on, I’ve been using the dev server with HTTPS on (thanks to the explanations in the doc), with success. However, I have recently upgraded CRA. Please note that I have ejected, so every once in a while I just scafold a new cra app, and merge the differences in my projet, I have done it twice so fare with success, this is the third time. I haven’t noted the previous cra version I’ve used, but from package.json I can see I’ve been from webpack 2.6.1 to 3.8.1

Now, I have no problems when HTTPS if false, but when HTTPS is true, my app is getting into an infinite loop of XHR requests coming from sockjs-node.

Of course, I’ve tested a freshly generated CRA app with HTTPS, and it works fine. However, after copy/pasting my project inside, and installing all new packages using yarn. I run into this issue…

While I don’t understand what triggers this problem, I have a feeling that the infinite loop comes from the live reload feature in webpackDevServer.config.js. So of course, this problem won’t happened when serving a production version of the app behing a SSL cert.

Expected Behavior

when developing using HTTPS with my application, there shouldn’t be any infinite loops caused by the dev server.

Actual Behavior

Here is a GIF of the infinite XHR request

ezgif com-optimize

and the headers from one call

xh

the preview

pre

I am also always getting this message in the console

The development server has disconnected. Refresh the page if necessary.

and sometimes, I get this error in the console

htmlfile?c=_jp.amifsnd:8 Uncaught DOMException: Blocked a frame with origin "https://localhost:3000" from accessing a cross-origin frame. at https://localhost:3000/sockjs-node/723/dnduswa3/htmlfile?c=_jp.amifsnd:8:20

Reproducible Demo

I haven’t been able to point out myself where the problem lies, so I don’t want to copy paste you a huge project with lots of dependencies as it will be a waste of time for you.

However if this kind of issue rings a bell, or if you can point me in the right direction… I would appreciate it a lot!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kyriacoscommented, Apr 19, 2018

@Timer I’m also experiencing the same issue and i haven’t ejected. I looked at the linked issue. Based on what i saw it’s not something that accessible in a config. You mentioned moving away from webpack-dev-server. Is that part of the upcoming release?

Thanks

1reaction
jhchill666commented, Mar 16, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

React - Infinite looping xhr sockjs-node - Stack Overflow
Webpack-dev-server injects some js code in your bundle which makes those requests.
Read more >
sockjs-node/info in production : r/reactjs - Reddit
In my production build, my app is trying to make the following request ' http://localhost:3000/sockjs-node/info?
Read more >
A brand new website interface for an even better experience!
infinite XHR calls from sockjs-node when using HTTPS.
Read more >
Socksjs Infinite Loop With Vue.Js - ADocLib
After that, it gets closed as expected. However, the xhr_streaming transport starts an infinite loop: it tries to connect to the server, then...
Read more >
sockjs-client-web-timeout - npm
Start using sockjs-client-web-timeout in your project by running `npm i ... SockJS-node is a SockJS server for Node.js. Philosophy:.
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