diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index ce0c18b1b4..3b8961f23d 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -142,7 +142,11 @@ function sendMessage(socket: WebSocket, message: unknown): void { return; } - socket.send(JSON.stringify(message)); + try { + socket.send(JSON.stringify(message)); + } catch { + // Best-effort event delivery. Socket may have transitioned states. + } } function decodeClientMessage(raw: RawData): string | null {