Skip to content

[Bug]: Linux -> child processes inherit ELECTRON_RUN_AS_NODE=1 and break other Electron apps #1162

@gustavoilhamorais

Description

@gustavoilhamorais

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Launch T3 Code
  2. From its environment, run:
    • env | grep ELECTRON_RUN_AS_NODE
    • obsidian help
  3. Observe:
    • ELECTRON_RUN_AS_NODE=1
    • Obsidian fails with Cannot find module 'electron'
  4. Run:
    • env -u ELECTRON_RUN_AS_NODE obsidian help
  5. Observe:
    • Obsidian works normally

Expected behavior

ELECTRON_RUN_AS_NODE=1 should stay scoped to the internal process that needs it and should not be inherited by external commands/apps launched from T3 Code.

Actual behavior

On Linux desktop builds, commands launched from the T3 Code environment can inherit ELECTRON_RUN_AS_NODE=1.

That breaks unrelated Electron apps started from that environment. In my case, obsidian help fails with:

Error: Cannot find module 'electron'

Impact

Major degradation or frequent failure

Version or commit

0.0.11

Environment

linux-lts 6.18.18-1, Hyprland 0.54.2, Node.js 22.22.1, NPM 11.11.1

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

This does not seem to be a global OS/session issue.

  • Hyprland does not have ELECTRON_RUN_AS_NODE
  • the main t3-code-desktop process does not have it
  • the child process running .../resources/app.asar/apps/server/dist/index.mjs does have it
  • descendants inherit it from there

So the variable appears to leak from the internal server process into child commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions