fix(ui): install devDependencies during ui:build (closes #53027)#59267
Conversation
Greptile SummaryThis PR fixes a real bug where Key changes:
The suggested fix is to destructure Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: scripts/ui.js
Line: 187-188
Comment:
**`NODE_ENV=production` passthrough still skips devDependencies in CI**
The fix removes the explicit `{ ...process.env, NODE_ENV: "production" }` override and the `--prod` flag, which is correct. However, `installEnv = process.env` is a direct reference to the current environment — meaning that if the caller already has `NODE_ENV=production` set (which CI pipelines routinely do), pnpm will still install production-only dependencies and skip `devDependencies` like `vite` and `postcss`. The original bug would regress in any environment where `NODE_ENV` is already `"production"`.
The fix should explicitly neutralize `NODE_ENV` for the install step:
```suggestion
const { NODE_ENV: _stripped, ...installEnv } = process.env;
const installArgs = ["install"];
```
This removes `NODE_ENV` from the environment passed to `pnpm install` without mutating `process.env`, ensuring devDependencies are always installed regardless of the calling environment. The actual build step (`run(runner.cmd, ...)`) still inherits the full `process.env` (including any `NODE_ENV=production`), so production-mode bundling behaviour is preserved.
Note: The PR description explicitly acknowledges "What you did NOT verify: CI environments" — this is likely why the regression would only surface there.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(ui): install devDependencies during ..." | Re-trigger Greptile |
bd3a492 to
64219a8
Compare
obviyus
left a comment
There was a problem hiding this comment.
Reviewed latest changes; landing now.
64219a8 to
956b838
Compare
|
Landed on main. Thanks @juliabush. |
) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
scripts/ui.js self-installs devDeps for ui:build (openclaw#59267), and the extra ui:install was removing workspace packages without re-adding them, leaving vite off PATH. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…juliabush) * fix(ui): install devDependencies during ui:build * fix: keep ui:build self-heal documented (openclaw#59267) (thanks @juliabush) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
ui:buildinstalls production-only dependencies (--prod+NODE_ENV=production), which strips devDependencies required for Vite/PostCSS.pnpm installwith full dependency set.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
scripts/ui.jsconditionally installs dependencies with--prodandNODE_ENV=productionduring build, removing required devDependencies.Regression Test Plan (if applicable)
ui:buildsucceeds without manual installUser-visible / Behavior Changes
pnpm installworkaround requiredDiagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
pnpm ui:buildExpected
Actual
Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations