Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): cyclic dependency server <-> ws

Elian Doranae1a4fbbf6eb
diff --git a/apps/client/src/services/server.ts b/apps/client/src/services/server.ts
index 861a20e602..cb557b19b4 100644
--- a/apps/client/src/services/server.ts
+++ b/apps/client/src/services/server.ts
@@ -1,6 +1,5 @@
import utils, { isShare } from "./utils.js";
import ValidationError from "./validation_error.js";
-import { throwError } from "./ws.js";
type Headers = Record<string, string | null | undefined>;
@@ -277,6 +276,7 @@ async function reportError(method: string, url: string, statusCode: number, resp
} else {
const title = `${statusCode} ${method} ${url}`;
toastService.showErrorTitleAndMessage(title, messageStr);
+ const { throwError } = await import("./ws.js");
throwError(`${title} - ${message}`);
}
}