chore(server): fix error in Electron port handling

This commit is contained in:
Elian Doran
2026-03-28 12:14:59 +02:00
parent 0b784af4ca
commit 7f6a43c2fa

View File

@@ -158,11 +158,13 @@ function startHttpServer(app: Express) {
}
if (utils.isElectron()) {
if ("code" in error && error.code === "EADDRINUSE" && (process.argv.includes("--new-window") || !app.requestSingleInstanceLock())) {
console.error(message);
} else {
getPlatform().crash(`Error while initializing the server: ${message}`);
}
import("electron").then(({ app }) => {
if ("code" in error && error.code === "EADDRINUSE" && (process.argv.includes("--new-window") || !app.requestSingleInstanceLock())) {
console.error(message);
} else {
getPlatform().crash(`Error while initializing the server: ${message}`);
}
});
} else {
getPlatform().crash(message);
}