Skip to content

fix(dot deploy): always install before build, surface build errors clearly#192

Merged
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/auto-install-and-build-error-display
May 20, 2026
Merged

fix(dot deploy): always install before build, surface build errors clearly#192
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/auto-install-and-build-error-display

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • Always install before build. detectInstallConfig previously skipped pnpm install (or PM equivalent) when node_modules/ already existed. A stale node_modules/ from a branch switch or lockfile bump bypassed that guard and let Vite build against package versions that didn't match the lockfile, producing opaque "X is not exported by Y" errors. We now install unconditionally so the PM can reconcile — idempotent (~1s no-op) when in sync.
  • Surface the actual build error. runStreamed kept only the last 10 lines of output in its rejection message. Vite/Rollup print the meaningful error first and then a 10–20 line stack trace, so the slice consistently dropped the message. Widened to the full 40-line tail buffer.
  • Stop double-rendering the deploy failure. DeployScreen's per-section rows each set value={state.error} while the screen-level "deploy failed" row rendered the same message a second time, and the frontend's upload + dotns row showed the error even when it was the build step that failed. Dropped the in-section error text; the mark indicates which step failed and the bottom row carries the message once.

Test plan

  • pnpm format:check && pnpm lint:license && pnpm build && pnpm test — green locally (547 tests)
  • dot deploy against a project with a stale node_modules/ (e.g. checked out before a lockfile bump, no manual pnpm i) reconciles dependencies and builds successfully instead of failing with an opaque export error
  • When a build genuinely fails (force an invalid import), the rendered failure shows the actual Vite/Rollup error message (not just stack frames) and the message appears exactly once in the TUI
  • CI gates (Format, Lint, build, unit + e2e) pass

…early

`detectInstallConfig` previously short-circuited when a `node_modules/`
directory existed at the project root. A stale `node_modules/` left over
from a branch switch or lockfile bump bypassed that guard and let Vite
build against package versions that didn't match the lockfile, producing
opaque "X is not exported by Y" errors. Install unconditionally so
pnpm/yarn/npm can reconcile (idempotent ~1s no-op when in sync). Drops
the now-dead `hasNodeModules` field from `DetectInput`.

Also fixes two CLI bugs that compounded the problem when a build did fail:

- `runStreamed` only kept the last 10 lines of build output in the
  rejection message. Vite/Rollup print the actual error followed by a
  10–20 line stack trace, so the slice consistently dropped the
  message and showed only the trace. Widen the snippet to the full
  40-line tail buffer.
- `DeployScreen`'s frontend / contracts / playground rows each set
  `value={state.error}` while the screen-level "deploy failed" row at
  the bottom rendered the same message a second time. Worse, the
  frontend's `upload + dotns` row showed the error even when it was
  the `build` step that failed. Drop the in-section error text so the
  `✕` mark indicates which step failed and the bottom row carries the
  message once.

Adds a Vite-shaped regression test to `process.test.ts` ensuring an
"error message + long stack trace" output preserves the message
end-to-end.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit ec2e865 into main May 20, 2026
18 of 19 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the fix/auto-install-and-build-error-display branch May 20, 2026 09:39
@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: fix/auto-install-and-build-error-display · Commit: c206134 · Run logs

Cell Result Time
pr-deploy-frontend ✅ PASS 3m42s
pr-preflight ✅ PASS 1m39s
pr-deploy-cdm ✅ PASS 2m44s
pr-init-session ✅ PASS 2m08s
pr-deploy-foundry ✅ PASS 1m10s
pr-mod ✅ PASS 1m14s
pr-install ✅ PASS 0m46s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m00s

Sentry traces: view spans for this run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant