Skip to content

Build your personal knowledge base with Trilium Notes

fix(standalone): error in WS initialization

Elian Doran04826074f42d
diff --git a/apps/client/src/services/ws.ts b/apps/client/src/services/ws.ts
index e4c91c08d9..c94425b13b 100644
--- a/apps/client/src/services/ws.ts
+++ b/apps/client/src/services/ws.ts
@@ -253,6 +253,11 @@ function connectWebSocket() {
}
async function sendPing() {
+ if (!ws) {
+ // In standalone mode, there's no WebSocket — nothing to ping.
+ return;
+ }
+
if (Date.now() - lastPingTs > 30000) {
console.warn(utils.now(), "Lost websocket connection to the backend");
toast.showPersistent({