Skip to content

fix(updatenotification): use process.argv[0] as restart binary#4163

Merged
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:update
May 20, 2026
Merged

fix(updatenotification): use process.argv[0] as restart binary#4163
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:update

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

@KristjanESPERANTO KristjanESPERANTO commented May 20, 2026

The restart approach I introduced in #4156 still crashes under Electron:

TypeError: Cannot read properties of undefined (reading 'disableHardwareAcceleration')
    at electron.js:18

nodeRestart() hardcodes node as the interpreter, but under Electron process.argv[0] is the Electron binary. Spawning node js/electron.js causes require("electron") to return a string instead of the API, so electron.app is undefined.

This uses process.argv[0] as the binary directly, which works for both Electron and plain Node.

I introduced more variables for more clarity.

Fixes #4154.

PR MagicMirrorOrg#4156 hardcoded `node` as the interpreter, causing a crash
when restarting under Electron - `require("electron")` returns
only a path string in plain Node, making `electron.app` undefined.

Closes MagicMirrorOrg#4154
@khassel khassel merged commit 1b540ae into MagicMirrorOrg:develop May 20, 2026
12 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the update branch May 20, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants