diff --git a/packages/socket.io-client/lib/socket.ts b/packages/socket.io-client/lib/socket.ts index 973bafb32..923b5686f 100644 --- a/packages/socket.io-client/lib/socket.ts +++ b/packages/socket.io-client/lib/socket.ts @@ -834,8 +834,8 @@ export class Socket< this._pid = pid; // defined only if connection state recovery is enabled this.connected = true; this.emitBuffered(); - this.emitReserved("connect"); this._drainQueue(true); + this.emitReserved("connect"); } /**