fix(web): build web UI with NODE_ENV=development so devDependencies install#17906
Open
OnTheDotMediaLtd wants to merge 1 commit into
Open
fix(web): build web UI with NODE_ENV=development so devDependencies install#17906OnTheDotMediaLtd wants to merge 1 commit into
OnTheDotMediaLtd wants to merge 1 commit into
Conversation
…nstall The bundled TUI launcher (_launch_tui in hermes_cli/main.py) sets NODE_ENV=production on its node subprocess, and that env is inherited by every shell, slash-command, and `hermes update` invocation spawned from inside the TUI. Many CI/deploy shells also set NODE_ENV=production system-wide. When _build_web_ui then calls `npm install` (or `npm ci`) inside web/, npm >= 9 honors NODE_ENV=production and skips devDependencies. typescript lives in devDependencies, so tsc is not installed, and the subsequent `tsc -b && vite build` fails with 'tsc: not found'. The non-fatal branch swallows the failure as a warning and `hermes update` otherwise reports success, leaving the user with a stale or missing web_dist/ bundle. Fix at the build site: - _build_web_ui now constructs a child env with NODE_ENV=development for the npm install + build subprocesses. - _run_npm_install_deterministic accepts and forwards an explicit env= kwarg so both `npm ci` and the `npm install` fallback honor the override. Verified locally on a WSL install where NODE_ENV=production is in the environment: before the fix, `npm install --silent && npm run build` fails with 'sh: 1: tsc: not found'; after the fix the same shell produces a clean web_dist/ build.
This was referenced May 14, 2026
hermes update fails web UI build when NODE_ENV=production — npm install omits devDependencies
#27430
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes update(and any path that calls_build_web_ui) silently fails tobuild the web UI when
NODE_ENV=productionis in the environment. The buildprints
⚠ Web UI build failed (hermes web will not be available)while therest of the update reports success, so users only notice when
hermes webserves a stale or missing bundle. This PR forces
NODE_ENV=developmentforthe npm install + build child processes inside
_build_web_uiand threads anexplicit
env=kwarg through_run_npm_install_deterministicsonpm ciand the
npm installfallback both honor it.Root cause
hermes_cli/main.py:1150(_launch_tui) setsNODE_ENV=productionon thenode TUI subprocess.
hermes updatespawned under the TUIinherits it, verified by walking
/proc/<pid>/environup the parent chain.NODE_ENVis not in~/.bashrc,~/.zshrc,~/.profile,/etc/environment, or any/etc/profile.dscript — the TUI is the solesource on a fresh install. With
NODE_ENV=productionset,npm installon npm ≥ 9 skips
devDependencies, sotypescriptis missing andtsc -b && vite buildfails withsh: 1: tsc: not found.Diff
Impact
Affects any user running the bundled web-UI build path with
NODE_ENV=productionset — in practice, anyone runninghermes updatefrominside the Hermes TUI (the default workflow), CI/CD pipelines, and Docker
images that adopt the
NODE_ENV=productionconvention. The failure issilent in the non-fatal branch, so installs that look successful can ship
with a stale
hermes_cli/web_dist/.Verification
With
NODE_ENV=productionexported and a wipednode_modules/web_dist/: before this patch,npm install --silent && npm run buildfails with
sh: 1: tsc: not found. After:✓ built in 5.35s.Test plan
The existing assertion in
tests/hermes_cli/test_tui_resume_flow.py(
env["NODE_ENV"] == "production") is unchanged, since this PR does nottouch the TUI launcher. A targeted regression test calling
_build_web_uiwith
NODE_ENV=productionset inos.environand asserting thesubprocess
env=carriesNODE_ENV=developmentwould slot undertests/hermes_cli/. I can add it in this PR or a follow-up — pick whicheverfits the maintainers' usual cadence.
Alternative framings
NODE_ENVfrom the TUI subprocess env in_launch_tui.complementary cleanup.