From 705ba509cb878622d741e4be737b0d6a8885bab1 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Mon, 31 Jul 2023 00:54:46 +1000 Subject: [PATCH] fix: do not inject to sqlite srcs, fixes infinite loading --- src/init.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/init.js b/src/init.js index ee1d688..de5529a 100644 --- a/src/init.js +++ b/src/init.js @@ -19,7 +19,24 @@ if (isElectron()) { const { enhancerUrl } = globalThis.__enhancerApi, { getMods, isEnabled, modDatabase } = globalThis.__enhancerApi; + // calling require("electron") in a process require()-d + // from these paths throws "websocket connection to __ failed" + // and triggers infinite loading => ignore for now, but + // requires further investigation later + const ignoredPaths = [ + "shared/sqliteTypes", + "shared/TimeSource", + "shared/retryHelpers", + "shared/PromiseUtils", + "shared/typeUtils", + "shared/utils", + "shared/sqliteHelpers", + "main/sqlite/SqliteConnectionWrapper", + "main/sqlite/SqliteServer", + ]; + module.exports = async (target, __exports, __eval) => { + if (ignoredPaths.includes(target)) return; if (target === "main/main") require("./worker.js"); // clientStyles