Skip to content

fix(scripts): strip ELECTRON_RUN_AS_NODE before spawning Electron#758

Merged
brafdlog merged 1 commit intomasterfrom
fix/electron-run-as-node-leak
Apr 26, 2026
Merged

fix(scripts): strip ELECTRON_RUN_AS_NODE before spawning Electron#758
brafdlog merged 1 commit intomasterfrom
fix/electron-run-as-node-leak

Conversation

@brafdlog
Copy link
Copy Markdown
Owner

VSCode is itself an Electron app and sets ELECTRON_RUN_AS_NODE=1 in its terminal/extension-host environment. When yarn watch or yarn scrape are run from a VSCode integrated terminal, that var inherits down to the Electron child, forcing it into Node-only mode. The result: import { app } from 'electron' (and require('electron')) fail with "does not provide an export named 'app'", because the GUI Electron runtime never initializes.

Strip the var from the spawn env in both scripts. No effect on the postinstall script, which sets it explicitly via cross-env.

VSCode is itself an Electron app and sets ELECTRON_RUN_AS_NODE=1 in
its terminal/extension-host environment. When `yarn watch` or
`yarn scrape` are run from a VSCode integrated terminal, that var
inherits down to the Electron child, forcing it into Node-only mode.
The result: `import { app } from 'electron'` (and `require('electron')`)
fail with "does not provide an export named 'app'", because the GUI
Electron runtime never initializes.

Strip the var from the spawn env in both scripts. No effect on the
postinstall script, which sets it explicitly via cross-env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brafdlog brafdlog merged commit 305e9a8 into master Apr 26, 2026
10 checks passed
@brafdlog brafdlog deleted the fix/electron-run-as-node-leak branch April 26, 2026 17:59
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.18.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant