You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is a pretty much a dupe of #1023, but that issue wasn't really solved and now seems dead.
I've googled a bit, but this solution(-ish) from @w0xz doesn't really apply to me, since I'm running an Angular 5 app and the socket initialization is happening in components.
Additionally, #881 claimed to have solved #485, but I guess that PR didn't get merged?
I understand that it's an exception thrown by Chrome itself, and it may also be an engine.io or zone.js issue, but I figure this is the best place to start.
My issue is that I'm getting this exception thrown in the Chrome console when my Angular 5 app is running and my local nodeJS server isn't:
GET http://localhost:7070/socket.io/?EIO=3&transport=polling&t=M1NX3_U
net::ERR_CONNECTION_REFUSED
The socket.io events are being emitted properly when I log them like so:
this.socket=SocketIO(this.socketURL,this.socketOptions);this.socket.on('connect_error',(error)=>{console.log('connection_error',error);// this is getting logged, like it's supposed to// ^ same for all the other events from the socket});this.socket.io.on('connect_error',(error)=>{console.log('connection_error',error);// this is also getting logged, like it's supposed to// ^ same for all the other events from the socket manager});
However, the exception is getting thrown in the console anyway, even when I have handlers for all the events listed in the docs, both from the socket and the socket manager.
Steps to reproduce (if the current behaviour is a bug)
Run an app using socket.io-client and a server using socket.io, then stop the server (or run only the app).
Expected behaviour
My impression is that handling the socket and socket.io events should prevent a connection-refused error from being thrown and/or logged.
It's a nuisance during clientside development when I don't have my local server running, even if I catch and don't log the socket.io events, the exception fills up my Chrome console with a sea of red, and I'd rather not turn off autoReconnect every time I switch between local and live environments.
Setup
Windows 10
Chrome 65
socket.io-client v2.0.4
zone.js v0.8.20
angular v5.1.3
Other information (e.g. stacktraces, related issues, suggestions how to fix)
I traced down into the engine.io and zone.js calls, and it's getting thrown somewhere when the XMLHttpRequest is getting sent during XHR polling, when the send call is applied in zone's task scheduling. For some reason any changes to the XMLHttpRequest file aren't getting applied (I suspect an angular-cli issue since it's in node_modules, but other changes are working, so I don't know), so I couldn't log anything from the send call or try to catch the exception at the level where it's probably actually being thrown.
Stacktrace (the line numbers have probably since changed, but the second half is the important part anyway) from right before the request.send() call gets applied in zone (when the exception gets thrown):
at ZoneTask.scheduleTask [as scheduleFn] (webpack-internal:///../../../../zone.js/dist/zone.js:2933:25)
at ZoneDelegate.scheduleTask (webpack-internal:///../../../../zone.js/dist/zone.js:411:32)
at Object.onScheduleTask (webpack-internal:///../../../../zone.js/dist/zone.js:301:35)
at ZoneDelegate.scheduleTask (webpack-internal:///../../../../zone.js/dist/zone.js:405:51)
at Zone.scheduleTask (webpack-internal:///../../../../zone.js/dist/zone.js:236:43)
at Zone.scheduleMacroTask (webpack-internal:///../../../../zone.js/dist/zone.js:259:25)
at eval (webpack-internal:///../../../../zone.js/dist/zone.js:2966:35)
at XMLHttpRequest.proto.(anonymous function) [as send] (webpack-internal:///../../../../zone.js/dist/zone.js:1366:30)
at Request.create (webpack-internal:///../../../../engine.io-client/lib/transports/polling-xhr.js:263:9)
at new Request (webpack-internal:///../../../../engine.io-client/lib/transports/polling-xhr.js:164:40)
at XHR.request (polling-xhr.js:92)
at XHR.doPoll (polling-xhr.js:122)
at XHR.Polling.poll (polling.js:118)
at XHR.Polling.doOpen (polling.js:63)
at XHR.Transport.open (transport.js:80)
at Socket.open (socket.js:245)
at new Socket (socket.js:119)
at Socket (socket.js:28)
at Manager.open.Manager.connect (manager.js:226)
at eval (manager.js:540)
at ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.js:4747)
at ZoneDelegate.invokeTask (zone.js:424)
at Zone.runTask (zone.js:192)
at ZoneTask.invokeTask (zone.js:499)
at ZoneTask.invoke (zone.js:488)
at timer (zone.js:2040)
[it wouldn't log anything before timer]
The text was updated successfully, but these errors were encountered:
chandrajob365
added a commit
to chandrajob365/traceroute-visualizer
that referenced
this issue
Jan 1, 2018
Chrome showing errors in the console on failed WS connections is a chrome bug, fyi. It happens if you use websockets directly regardless of whether you set an error handler. So if you want it fixed it's worth filing a bug over on the chromium bug tracker.
For future readers: ERR_CONNECTION_REFUSED errors are emitted by the browser itself, and there is unfortunately nothing that we can do to silence them.
You want to:
[x] report a bug
[ ] request a feature
Current behaviour
I know this is a pretty much a dupe of #1023, but that issue wasn't really solved and now seems dead.
I've googled a bit, but this solution(-ish) from @w0xz doesn't really apply to me, since I'm running an Angular 5 app and the socket initialization is happening in components.
Additionally, #881 claimed to have solved #485, but I guess that PR didn't get merged?
I understand that it's an exception thrown by Chrome itself, and it may also be an engine.io or zone.js issue, but I figure this is the best place to start.
My issue is that I'm getting this exception thrown in the Chrome console when my Angular 5 app is running and my local nodeJS server isn't:
The socket.io events are being emitted properly when I log them like so:
However, the exception is getting thrown in the console anyway, even when I have handlers for all the events listed in the docs, both from the socket and the socket manager.
Steps to reproduce (if the current behaviour is a bug)
Run an app using socket.io-client and a server using socket.io, then stop the server (or run only the app).
Expected behaviour
My impression is that handling the socket and socket.io events should prevent a connection-refused error from being thrown and/or logged.
It's a nuisance during clientside development when I don't have my local server running, even if I catch and don't log the socket.io events, the exception fills up my Chrome console with a sea of red, and I'd rather not turn off autoReconnect every time I switch between local and live environments.
Setup
Other information (e.g. stacktraces, related issues, suggestions how to fix)
I traced down into the engine.io and zone.js calls, and it's getting thrown somewhere when the XMLHttpRequest is getting sent during XHR polling, when the send call is applied in zone's task scheduling. For some reason any changes to the XMLHttpRequest file aren't getting applied (I suspect an angular-cli issue since it's in node_modules, but other changes are working, so I don't know), so I couldn't log anything from the send call or try to catch the exception at the level where it's probably actually being thrown.
Stacktrace (the line numbers have probably since changed, but the second half is the important part anyway) from right before the request.send() call gets applied in zone (when the exception gets thrown):
[it wouldn't log anything before timer]
The text was updated successfully, but these errors were encountered: