#11951: Prepending Windows Node to PATH didn’t help
scripts
size: S
Cluster:
Build and Fix Enhancements
Cause: Prepending Windows Node to PATH didn’t help because the Windows pnpm binary (the script at /mnt/c/.../pnpm) is executed by the same shell and does exec node; in that context node still wasn’t found (e.g. WSL vs. Windows path or exec behavior).
Fix: The script no longer uses pnpm for the steps that need Node. It runs:
1. tsc as: "$NODE" node_modules/typescript/bin/tsc -p vendor/a2ui/renderers/lit/tsconfig.json
2. rolldown as: "$NODE" node_modules/rolldown/bin/cli.mjs -c apps/shared/OpenClawKit/Tools/CanvasA2UI/rolldown.config.mjs
So:
- The same $NODE used for the hash step is used for tsc and rolldown (no pnpm exec).
- Only relative paths are passed, so Windows Node always resolves them from the repo root and path-style issues are avoided.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `scripts/bundle-a2ui.sh` to resolve a usable `node` executable across environments (including Git Bash/WSL) and to avoid invoking Node via `pnpm exec`. It also changes the hashing and build steps to use `$NODE` directly and to pass only relative paths to TypeScript/Rolldown to avoid Unix-path issues with Windows Node.
The main functional risk is that the script now relies on the caller’s current working directory for both hashing (`process.cwd()`) and the `tsc`/`rolldown` invocations (relative paths). If the script is invoked from outside the repo root (e.g., `~/bin/bundle-a2ui.sh`), it can fail or compute an incorrect hash unless it `cd`s to `$ROOT_DIR` (or uses absolute paths).
<h3>Confidence Score: 3/5</h3>
- This PR is mergeable after fixing a working-directory bug that can break bundling/hashing when invoked outside the repo root.
- The change is localized to a shell script and the intent is clear, but the switch to `process.cwd()` plus relative config paths will definitely fail or mis-hash when the script isn’t run from the repo root. Fixing this (e.g., `cd $ROOT_DIR`) should make the change low risk.
- scripts/bundle-a2ui.sh
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#19905: build: replace bash script with cross-platform node script for a2ui...
by luolin-ai · 2026-02-18
83.9%
#18493: making pnpm build:ui and pnpm build to work on windows
by darkpowerxo · 2026-02-16
83.7%
#3006: fix(scripts): use local pnpm binary in run-node.mjs if global is mi...
by elliotsecops · 2026-01-27
82.8%
#6064: fix(daemon): prefer bundled node from install-cli.sh over system node
by joyshmitz · 2026-02-01
82.5%
#16480: fix(build): replace bash A2UI bundle script with cross-platform Typ...
by colddonkey · 2026-02-14
82.2%
#10292: Build: migrate A2UI packaging script from bash to TypeScript
by JAVA-LW · 2026-02-06
80.7%
#3973: fix: enhance npm package integrity checks and include critical files
by YeSuX · 2026-01-29
80.3%
#22425: chore: make prepare git hooks setup cross-platform
by OldFineDev · 2026-02-21
79.7%
#12804: fix(daemon): use wrapper script for pnpm global installs in service...
by odinho · 2026-02-09
79.4%
#6235: fix: from source development command
by witcxc · 2026-02-01
78.6%