From 8b81cceb17800c2b249842edf87156d0272e2ebd Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 24 Jun 2026 23:38:59 -0700 Subject: [PATCH] fix(desktop): externalize @fusion/engine so desktop release builds pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit local-runtime.ts dynamically imports @fusion/engine, but it was missing from the esbuild externals list (only @fusion/core and @fusion/dashboard were there). esbuild followed the import and tried to bundle engine's transitive node-pty native .node binaries, failing with "No loader is configured for .node files" — which broke every desktop Windows EXE and macOS DMG build leg. Externalize @fusion/engine like the other workspace packages; it resolves from node_modules at runtime. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/desktop/scripts/build.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/desktop/scripts/build.ts b/packages/desktop/scripts/build.ts index 728b875ac0..7c4fb4b453 100644 --- a/packages/desktop/scripts/build.ts +++ b/packages/desktop/scripts/build.ts @@ -5,10 +5,18 @@ import { buildDashboardClient, packageRoot, workspaceRoot } from "./workspace-to const dashboardClientDir = join(workspaceRoot, "packages", "dashboard", "dist", "client"); const desktopDistDir = join(packageRoot, "dist"); const desktopClientDistDir = join(desktopDistDir, "client"); +// FNXC:DesktopBuild 2026-06-25-09:45: +// Every workspace @fusion/* package and native (.node) module must stay external +// to the Electron main/preload bundles — they resolve from node_modules at runtime. +// @fusion/engine was missing here, so esbuild followed local-runtime.ts's dynamic +// `import("@fusion/engine")` and tried to bundle engine's transitive node-pty +// (@homebridge/node-pty-prebuilt-multiarch) native binaries, failing with +// "No loader is configured for .node files" and breaking every desktop release build. const sharedExternals = [ "electron", "@fusion/core", "@fusion/dashboard", + "@fusion/engine", "better-sqlite3", ]; const mainExternals = sharedExternals;