fix(deploy): stop the build command resolving to the home workspace - #174
Conversation
`wrangler deploy` fails before it uploads anything:
No projects found in "/home/ubuntu"
ERR_PNPM_RECURSIVE_EXEC_NO_PACKAGE No package found in this workspace
`/home/ubuntu/pnpm-workspace.yaml` exists, so pnpm walks up past this repo,
treats the home directory as the workspace root, finds no packages there and
exits 1. Both `pnpm install` and `pnpm exec` hit it, and the build command runs
with `cwd: ".."`, which does not escape the problem — the workspace file is
above that too.
`--ignore-workspace` fixes the install. It does NOT fix `pnpm exec`, which reads
the flag as the name of the command to run:
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "--ignore-workspace" not found
Same for `--no-workspace-root-check`. Since the install now populates the repo's
own node_modules, the binary is addressable directly, so this calls
`./node_modules/.bin/vite` and drops `pnpm exec` entirely.
Verified end to end in the repo root: install completes, `vite build` writes
dist/public, "built in 7.01s".
Both configs carry the same command and both were broken. deploy/system-wrangler.jsonc
is the `--config` deploy path; wrangler.jsonc is the Workers Builds path.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2qFSSKdbsxo7AS8Buo247
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughBoth Worker build commands now install dependencies with ChangesWorker build command updates
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The Worker builds retain access to the root Vite dependency and check for generated client output. No concrete deployment risk is identified, so the change appears ready to merge. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes are confined to deployment builds and add a check before deployment. No change to Worker permissions, secrets, or runtime bindings was found, but production rollout behavior has not been verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review: fix(deploy): stop the build command resolving to the home workspaceSolid, narrowly-scoped fix for a real deploy blocker. A few notes: Correctness
Minor / non-blocking
Security / test coverage: N/A — build-tooling config only, no app code paths touched. Looks good to merge once a real deploy confirms it end-to-end. |
A separated adversarial review flagged that the previous revision could deploy successfully while serving an empty or stale dist/public: wrangler runs the build command, but nothing asserted the command actually produced a bundle. A silent empty build is worse than a failed one — the deploy reports success and the site breaks. `&& test -s dist/public/index.html` closes it. Verified both directions: exits 0 on a real build, non-zero when index.html is truncated to empty. The review's other blocking findings were checked against primary sources and did not hold: - `--ignore-workspace` does not change dependency resolution here. There is no pnpm-workspace.yaml in this repo, so the flag is a no-op wherever no workspace file sits above the checkout — which is every environment except the local one it was added to fix. - The relative binary path is correct in both configs. deploy/system-wrangler.jsonc sets `cwd: ".."` and wrangler.jsonc sets no cwd (so cwd is its own directory); both resolve to the repo root, where node_modules/.bin lives. - Exit codes do propagate through the `&&` chain — observed directly: the failing install aborted the deploy rather than continuing to upload. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W2qFSSKdbsxo7AS8Buo247
|
Review of #174. The change is small and looks correct. What I checked
Suggestions
No security or performance concerns. There are no tests to add, because this is deploy config. The build check you ran is the right verification. Approve, with the description tweak from item 1. 🤖 Generated with Claude Code |
The bug
wrangler deployfails before uploading anything:/home/ubuntu/pnpm-workspace.yamlexists, so pnpm walks up past this repo, treats the home directory as the workspace root, finds no packages, and exits 1. The build command'scwd: ".."does not help — the stray workspace file is above that too.Hit while deploying
03bfbd4(#173). This blocks every deploy, not just that one.Why the obvious fix is only half of it
--ignore-workspacefixespnpm install. It does not fixpnpm exec, which reads the flag as the name of the command to run:--no-workspace-root-checkfails identically. I tried both before settling on droppingpnpm exec: once the install populates the repo's ownnode_modules, the binary is addressable directly, so the command calls./node_modules/.bin/vite.Verified
Ran the exact new command in the repo root — install completes,
vite buildwritesdist/public,✓ built in 7.01s.Both configs
deploy/system-wrangler.jsonc(the--configdeploy path) andwrangler.jsonc(the Workers Builds path) carry the same command; both were broken, both fixed. They remain drifted oncompatibility_date(2026-03-01 vs 2026-08-07) and observability — pre-existing, untouched here.🤖 Generated with Claude Code
https://claude.ai/code/session_01W2qFSSKdbsxo7AS8Buo247
Summary by CodeRabbit
dist/publicdirectory and added a check that the generated site entry page exists and is not empty.