Majoren
Majoren

Reputation: 1043

Node keeps sending GET /sockjs-node/info requests after terminating with CTRL + C

I don't think it has much to do with the issue, but I'm running a react app in development environment, after terminating (i think) the node process with ctrl + c , I keep getting these requests.

enter image description here

Any clues? Thank's in advance.

Upvotes: 8

Views: 14847

Answers (3)

Ariel Carrera
Ariel Carrera

Reputation: 5213

I had this error when I mistakenly added a loop between two required javascript / typescript resources. On a resource "A", when the resource was loading, it was making a remote call to get a resource B. When the resource B required something from A, a require/import was added and it ended up in a loop, what it was solved splitting the file A to extract the required constant to another file removing the loop.

Upvotes: 1

Amin Aghabeiki
Amin Aghabeiki

Reputation: 117

Its happens when you use socket in your application. When your server loads in the browser, your socket client establishes a connection between the socket client and socket.io on server side. When you stop node application (CTRL + C) you just stop the server side loop, while the client side loop try to connect/reconnect to server and you get this error.

Upvotes: 6

rsp
rsp

Reputation: 111466

It looks like your browser is trying to connect to Node and it gets connection refused errors, which seems reasonable if you stopped the server.

What did you expect to get when you stop your server?

Upvotes: 1

Related Questions