From 57983b54d21eb27ac69b3a066c702ba044e3bcf3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 29 Aug 2025 23:24:12 +0300 Subject: [PATCH] fix(react/widgets): electron imports breaking browser --- apps/client/src/services/utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/client/src/services/utils.ts b/apps/client/src/services/utils.ts index c3ffab6d8..77fec1366 100644 --- a/apps/client/src/services/utils.ts +++ b/apps/client/src/services/utils.ts @@ -311,13 +311,13 @@ function copySelectionToClipboard() { } } -const dynamicRequireMappings = { - "@electron/remote": import("@electron/remote"), - "electron": import("electron"), - "child_process": import("child_process") +type dynamicRequireMappings = { + "@electron/remote": typeof import("@electron/remote"), + "electron": typeof import("electron"), + "child_process": typeof import("child_process") }; -export function dynamicRequire(moduleName: T): Awaited{ +export function dynamicRequire(moduleName: T): Awaited{ if (typeof __non_webpack_require__ !== "undefined") { return __non_webpack_require__(moduleName); } else {