From 1ea2a6d768a313214638dbddc68f1d025fd5cd41 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:14:40 -0400 Subject: [PATCH] fix: strip ELECTRON_RUN_AS_NODE from dev script environment (#769) --- config/scripts/run-electron-vite-dev.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/scripts/run-electron-vite-dev.mjs b/config/scripts/run-electron-vite-dev.mjs index 4794aa38..8cc21ebe 100644 --- a/config/scripts/run-electron-vite-dev.mjs +++ b/config/scripts/run-electron-vite-dev.mjs @@ -2,6 +2,12 @@ import { spawn } from 'node:child_process' import { createRequire } from 'node:module' import path from 'node:path' +// Why: Electron-based hosts (e.g. Claude Code, VS Code) set +// ELECTRON_RUN_AS_NODE=1 in their terminal environment. If this leaks into +// the electron-vite spawn, the Electron binary boots as plain Node and +// require('electron') returns the npm stub instead of the built-in API. +delete process.env.ELECTRON_RUN_AS_NODE + const require = createRequire(import.meta.url) // Why: tests inject a tiny fake CLI here so they can verify Ctrl+C tears down // the full child tree without depending on a real electron-vite install.