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
This commit is contained in:
Vitali Zaidman authored and meta-codesync[bot] committed 2025-12-10 01:49:36 -08:00
1 parent 7cecf15c59
commit 5e81ac92ba
1 file changed
+7
@@ -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', () => {