From 5e81ac92ba8714ab0635e5cf2731186a887dd9dc Mon Sep 17 00:00:00 2001 From: Vitali Zaidman Date: Wed, 10 Dec 2025 01:49:36 -0800 Subject: [PATCH] make the default debugger-shell spawn command unset ELECTRON_RUN_AS_NODE (#54654) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54654 make the default debugger-shell spawn command unset ELECTRON_RUN_AS_NODE Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D86673603 fbshipit-source-id: 0233468ac516031c0fd5c7ee568962345dc31829 --- packages/debugger-shell/src/node/index.flow.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/debugger-shell/src/node/index.flow.js b/packages/debugger-shell/src/node/index.flow.js index 7c4e06831c5..82d6223d9c7 100644 --- a/packages/debugger-shell/src/node/index.flow.js +++ b/packages/debugger-shell/src/node/index.flow.js @@ -51,6 +51,13 @@ async function unstable_spawnDebuggerShellWithArgs( stdio: 'inherit', windowsHide: true, detached: mode === 'detached', + env: { + ...process.env, + // If this package is used in an Electron app (e.g. inside a VS Code extension), + // ELECTRON_RUN_AS_NODE=1 can leak from the parent process. + // Since this is never the right way to launch the Fusebox shell, we guard against it here. + ELECTRON_RUN_AS_NODE: '', + }, }); if (mode === 'detached') { child.on('spawn', () => {