fix(cli): say which build output is missing, not just "no index.html" - #619
Open
claude[bot] wants to merge 1 commit into
Open
fix(cli): say which build output is missing, not just "no index.html"#619claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
A build that emits no Workers artifact takes the no-worker arm of the deployments lane, so `readIndexHtml()` is where a full-stack build that failed to emit its server lands — not only a genuinely static one. It reported every such case with one message, "No index.html found in "<dir>" — a static site needs one at the output directory root", which names a site type the caller never chose and does not say which of several very different conditions actually happened. Split the diagnosis four ways: no output directory configured and no artifact emitted, the directory missing, the directory empty, and the directory populated but with no entry point at its root. The last one names any index.html found deeper in the output, which is the signature of a client/server split build whose artifact was never emitted. The first two also restore the two guard rails the legacy tar.gz upload has in `deploySite()` and this lane had dropped. Diagnosis only — same throw, same `INVALID_INPUT` code (platform-side publish alerting keys on it), and the hints ride the `--json` envelope, which is the publish sandbox's only view of a failed deploy. No routing, transport or success-path behavior changes on either arm. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9GRcXmFAabLGUZkyRyaJd
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.14-pr.619.5a268b0Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.14-pr.619.5a268b0"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.14-pr.619.5a268b0"
}
}
Preview published to npm registry — try new features instantly! |
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.
Note
Description
When a deploy on the deployments-API lane finds no
index.htmlat the output root, it threw a single message — "No index.html found ... a static site needs one at the output directory root" — for four distinct situations: no output at all, a missing output directory, an empty one, and one whose entry point sits a level down. That message asserted a site type the caller never chose and hid the real cause (a full-stack build that failed to emit.wrangler/deploy/config.jsonfalls into the same no-worker arm), which sent a production publish failure hunting for a routing bug that did not exist. This PR splits the diagnosis into four specific messages with actionable hints, while keeping the throw and theINVALID_INPUTerror code the platform’s publish alerting keys on unchanged.Related Issue
None
Type of Change
Changes Made
packages/cli/src/core/site/deployment.ts: extracted the failure path out ofreadIndexHtml()into a newmissingIndexHtmlError()that distinguishes four causes:site.outputDirectory→ "No site output to deploy", hinting how to setsite.outputDirectoryinconfig.jsoncbase44 buildhint**/index.htmlfound deeper, plus a hint that a build emitting.wrangler/deploy/config.jsonwould have shipped its serverdeploySite()) already had and that this lane had dropped.--jsonerror envelope, which is the platform publish sandbox’s only view of a failed deploy.packages/cli/tests/cli/site_deploy_output_diagnostics.spec.ts(4 cases) covering each message, asserting each fails before the deployment create call and that the--jsonenvelope keepsINVALID_INPUTand carries the nested-path hint.docs/deployments.mdwith a "When there is no index.html to finalize with" section (condition→message table), a note that the error code must not change, new keywords, and a pointer to the new spec.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Diagnosis only — no control-flow change: every case that failed before still fails, at the same point, with the same
InvalidInputError/INVALID_INPUTcode. The.wrangler/deploy/config.jsonpath is spelled out as a literal in copy rather than reused fromWRANGLER_REDIRECT_PATH, since that constant is built withjoin()and would render with backslashes on Windows. The new spec mutates the copiedwith-sitefixture (nesting the index.html, emptying the directory, removing it) rather than adding new fixtures. Build and test commands could not be executed in this environment, so the "tested locally"/"all tests pass" boxes are left unchecked for a human to confirm.🤖 Generated by Claude | 2026-09-10 13:20 UTC | 5a268b0