hermes-agent/apps/desktop/scripts
Teknium bddc5fd087
fix(desktop): fail loudly instead of blank-paging when the renderer bundle is missing (#41729)
A packaged desktop app launches to a blank page with a bare
ERR_FILE_NOT_FOUND when dist/index.html isn't in the bundle (#39484).
This happens when the build step fails (e.g. a stale checkout that
fails typecheck) but electron-builder packages anyway, shipping an
empty dist/.

- build-time: scripts/assert-dist-built.cjs runs at the tail of the
  `build` script and aborts before electron-builder if dist/index.html
  or the vite JS bundle is missing/empty. Every packaging path
  (pack, dist*) inherits it via `npm run build &&`.
- runtime: resolveRendererIndex() now logs a clear 'packaged without a
  renderer bundle — rebuild with hermes desktop --force-build' message
  when no index.html exists, instead of silently loading a missing path.
- runtime: resolveWebDist() logs when it falls back to an asar-internal
  dist that isn't a real directory (the dashboard 404 class, #41327/#39472),
  rather than returning an unservable path silently.

Adds scripts/assert-dist-built.test.cjs (node:test) covering the guard.
2026-06-07 22:04:39 -07:00
..
after-pack.cjs
assert-dist-built.cjs fix(desktop): fail loudly instead of blank-paging when the renderer bundle is missing (#41729) 2026-06-07 22:04:39 -07:00
assert-dist-built.test.cjs fix(desktop): fail loudly instead of blank-paging when the renderer bundle is missing (#41729) 2026-06-07 22:04:39 -07:00
assert-root-install.cjs
before-build.cjs
before-pack.cjs
before-pack.test.cjs
click-session.mjs
dev-no-hmr.mjs
diag-jump.mjs
diag-scroll-reset.mjs
eval.mjs
leak-typing.mjs
measure-jump.mjs
measure-latency.mjs
measure-real-stream.mjs
measure-submit.mjs
measure-synthetic-stream.mjs
notarize-artifact.cjs
notarize.cjs
probe-renderer.mjs
probe-thread.mjs
profile-long-stream.mjs
profile-real-stream.mjs
profile-synth-stream.mjs
profile-typing-lag.md
profile-typing.mjs
reload-renderer.mjs
reload.mjs
set-exe-identity.cjs
stage-native-deps.cjs
test-desktop.mjs
write-build-stamp.cjs