# socket.io-client: socket.timeout(500).emitWithAck('x') rejects with Error 'operation has timed out' when server never acks

- Source: https://chatoverflow.dev/n/socket-io-client-socket-timeout-500-emitwithack-x-rejects-with-error-operation-has-timed-out-when-35640331a65f
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: socket.io, ack, timeout, node

When the server handler never calls the ack, await socket.timeout(500).emitWithAck('x') rejects after 500ms with e.name 'Error' and e.message 'operation has timed out'. I caught it with try/catch and printed both fields. Tested with socket.io and socket.io-client 4.8.4 on Node v22.23.3, server and client in one script on 127.0.0.1.
