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.

Missing error handler on `socket`. when using node.js v0.12

See original GitHub issue

:˜/test/socket.io$ npm test

socket.io@1.3.2 test /home/test/socket.io mocha --reporter dot --slow 200ms --bail

child_process: customFds option is deprecated, use stdio instead.

․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․ ․․․․․․․․․․․․․․․․․․․․․․․․․Note: warning expected and normal in test. Missing error handler on socket. Error: Illegal attachments at decodeString (/home/test/socket.io/node_modules/socket.io-parser/index.js:290:13) at Decoder.add (/home/test/socket.io/node_modules/socket.io-parser/index.js:238:14) at Client.ondata (/home/test/socket.io/lib/client.js:176:18) at Socket.emit (events.js:107:17) at Socket.onPacket (/home/test/socket.io/node_modules/engine.io/lib/socket.js:99:14) at WebSocket.emit (events.js:129:20) at WebSocket.Transport.onPacket (/home/test/socket.io/node_modules/engine.io/lib/transport.js:91:8) at WebSocket.Transport.onData (/home/socket.io/node_modules/engine.io/lib/transport.js:102:8) at WebSocket.onData (/home/socket.io/node_modules/engine.io/lib/transports/websocket.js:75:30) at WebSocket.emit (events.js:110:17) at Receiver.ontext (/home/socket.io/node_modules/engine.io/node_modules/ws/lib/WebSocket.js:798:10) at /home/socket.io/node_modules/engine.io/node_modules/ws/lib/Receiver.js:473:18 at /home/test/socket.io/node_modules/engine.io/node_modules/ws/lib/Receiver.js:357:7 at /home/test/socket.io/node_modules/engine.io/node_modules/ws/lib/PerMessageDeflate.js:217:5 at afterWrite (_stream_writable.js:361:3) at onwrite (_stream_writable.js:352:7) at WritableState.onwrite (_stream_writable.js:105:5)

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
darrachequesnecommented, May 12, 2022

For now, I think you can add an empty error handler:

socket.on("error", () => {});

We will remove this in the next major version, as this does not provide much value (the socket is disconnect in any case).

0reactions
Novivycommented, May 3, 2022

@Novivy yes, this could indeed be caused by a bad payload from the client:

https://github.com/socketio/socket.io/blob/9b43c9167cff817c60fa29dbda2ef7cd938aff51/lib/client.ts#L296-L301

any suggestions to PR this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting missing error handler socket message using Node.js ...
Your error is thrown because io object does not have property socket, but it has property sockets. So you should write this:
Read more >
[Solved]-Error: socket hang up using node v0.12.0-node.js
[Solved]-Error: socket hang up using node v0. 12.0-node. js. I see that you are are making a request to a secure server.
Read more >
Command-line API | Node.js v19.3.0 Documentation
Node.js comes with a variety of CLI options. These options expose built-in debugging, multiple ways to execute scripts, and other helpful runtime options....
Read more >
Node.js ChangeLog - Google Git
Idle sockets that have been kept alive now handle errors (José F. ... the same change now in Node.js v0.12 as per joyent/node#9048...
Read more >
Node.js Client Library Release Note | Download - Aerospike
[CLIENT-1745] Fixed build error identified in Alpine 3.15 and Node.js 17.9. ... Requires Node.js v4.x (LTS) or later; Node.js v0.12.x and io.js are...
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