What happened
After an in-app desktop update to current main, the Hermes desktop app fails to launch with a fatal uncaught exception:
Uncaught Exception:
Error: Cannot find module 'simple-git'
Require stack:
- .../Hermes.app/Contents/Resources/app.asar/electron/git-review-ops.cjs
- .../Hermes.app/Contents/Resources/app.asar/electron/main.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1483:15)
...
at require (node:internal/modules/helpers:153:16)
electron/main.cjs require()s electron/git-review-ops.cjs at module load, and that file does require('simple-git') at the top level, so the missing module is fatal at startup — the app never comes up.
Root cause
simple-git (added with the git worktree/review IPC feature) is declared in apps/desktop/package.json, but npm workspace dedup hoists it into the repo-root node_modules, out of reach of electron-builder's file collector:
build.files in apps/desktop/package.json is an explicit allow-list (dist, assets, electron, public, package.json) — the packaged app.asar ships no node_modules at all.
- The only runtime dep currently bundled is
node-pty, hand-staged by scripts/stage-native-deps.cjs + a process.resourcesPath fallback in main.cjs. simple-git got no equivalent staging and no fallback, so it ships nowhere.
ElectronAsarIntegrity (Info.plist) pins a SHA256 of app.asar, so patching the bundle in place is not viable — the dependency has to be staged at build time.
Steps to reproduce
- Build/package the desktop app from current
main (e.g. via the in-app update / hermes desktop --build-only).
- Launch the packaged
Hermes.app.
- App dies immediately with
Cannot find module 'simple-git'.
Environment
- Hermes desktop
main (reproduced at commit 208f0d7c3)
- macOS arm64 (packaging path is platform-independent — same hoisting issue on Windows/Linux)
Suggested fix
Mirror the existing node-pty handling: have scripts/stage-native-deps.cjs resolve simple-git's full dependency closure and stage it into build/native-deps/node_modules/ (shipped via the existing extraResources entry), and add a process.resourcesPath require fallback in git-review-ops.cjs. PR incoming.
What happened
After an in-app desktop update to current
main, the Hermes desktop app fails to launch with a fatal uncaught exception:electron/main.cjsrequire()selectron/git-review-ops.cjsat module load, and that file doesrequire('simple-git')at the top level, so the missing module is fatal at startup — the app never comes up.Root cause
simple-git(added with the git worktree/review IPC feature) is declared inapps/desktop/package.json, but npm workspace dedup hoists it into the repo-rootnode_modules, out of reach of electron-builder's file collector:build.filesinapps/desktop/package.jsonis an explicit allow-list (dist,assets,electron,public,package.json) — the packagedapp.asarships nonode_modulesat all.node-pty, hand-staged byscripts/stage-native-deps.cjs+ aprocess.resourcesPathfallback inmain.cjs.simple-gitgot no equivalent staging and no fallback, so it ships nowhere.ElectronAsarIntegrity(Info.plist) pins a SHA256 ofapp.asar, so patching the bundle in place is not viable — the dependency has to be staged at build time.Steps to reproduce
main(e.g. via the in-app update /hermes desktop --build-only).Hermes.app.Cannot find module 'simple-git'.Environment
main(reproduced at commit208f0d7c3)Suggested fix
Mirror the existing
node-ptyhandling: havescripts/stage-native-deps.cjsresolvesimple-git's full dependency closure and stage it intobuild/native-deps/node_modules/(shipped via the existingextraResourcesentry), and add aprocess.resourcesPathrequire fallback ingit-review-ops.cjs. PR incoming.