diff --git a/lib/websocket.js b/lib/websocket.js index 4391c73ab..de1b03b6a 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -1096,7 +1096,7 @@ function sendAfterClose(websocket, data, cb) { `WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})` ); - cb(err); + process.nextTick(cb, err); } }