[GH-ISSUE #3529] [Feature]: Warn at startup when the client build is missing instead of silently serving API-only #1905

Closed
opened 2026-10-21 05:43:42 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jul 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3529

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

When packages/client/dist doesn't exist, the server starts silently API-only: the static-file registration and the SPA fallback are both inside if (existsSync(clientDist)) { ... } (packages/server/src/app.ts:172), so nothing serves /, and the browser gets Fastify's bare JSON 404:

{"message":"Route GET:/ not found","error":"Not Found","statusCode":404}

Nothing in the launcher window or server log hints at the cause, so it reads like a broken install rather than a missing build. This bites in a real, recurring scenario: checking out a PR branch (or any fresh clone) means no dist/ (it's gitignored), and the launcher skips its rebuild step when its ff-only update doesn't land (e.g. on a non-main branch: [WARN] Update did not land on origin/main. Continuing with current version.) — so the server comes up, the API answers, and / 404s with no explanation. Hit exactly this today while testing a PR branch.

Proposed solution

A one-line warning in an else branch of the existsSync(clientDist) check, e.g.:

logger.warn("Client build not found at %s — serving API only. Run `pnpm build` to build the frontend.", clientDist);

That's the whole ask — make the silence say what's wrong and how to fix it.

Alternatives considered

  • Also registering a minimal GET / handler in the no-dist case that returns a plain-text/HTML hint ("Client build missing — run pnpm build") instead of the raw 404. Friendlier for people who only look at the browser, slightly more code; could be a follow-up on top of the log line.
  • Having the launcher rebuild even when the update doesn't land — larger behavioral change to update flow, out of scope for this ask.

Additional context

Repro: on a checkout without packages/client/dist (fresh clone or PR branch), start the server; open http://127.0.0.1:7860/ → JSON 404, no diagnostic anywhere. packages/server/src/app.ts:169-212 is the relevant block.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Jul 12, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3529 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? When `packages/client/dist` doesn't exist, the server starts **silently API-only**: the static-file registration and the SPA fallback are both inside `if (existsSync(clientDist)) { ... }` (`packages/server/src/app.ts:172`), so nothing serves `/`, and the browser gets Fastify's bare JSON 404: ```json {"message":"Route GET:/ not found","error":"Not Found","statusCode":404} ``` Nothing in the launcher window or server log hints at the cause, so it reads like a broken install rather than a missing build. This bites in a real, recurring scenario: checking out a PR branch (or any fresh clone) means no `dist/` (it's gitignored), and the launcher skips its rebuild step when its ff-only update doesn't land (e.g. on a non-main branch: `[WARN] Update did not land on origin/main. Continuing with current version.`) — so the server comes up, the API answers, and `/` 404s with no explanation. Hit exactly this today while testing a PR branch. ## Proposed solution A one-line warning in an `else` branch of the `existsSync(clientDist)` check, e.g.: ```ts logger.warn("Client build not found at %s — serving API only. Run `pnpm build` to build the frontend.", clientDist); ``` That's the whole ask — make the silence say what's wrong and how to fix it. ## Alternatives considered - Also registering a minimal `GET /` handler in the no-dist case that returns a plain-text/HTML hint ("Client build missing — run `pnpm build`") instead of the raw 404. Friendlier for people who only look at the browser, slightly more code; could be a follow-up on top of the log line. - Having the launcher rebuild even when the update doesn't land — larger behavioral change to update flow, out of scope for this ask. ## Additional context Repro: on a checkout without `packages/client/dist` (fresh clone or PR branch), start the server; open `http://127.0.0.1:7860/` → JSON 404, no diagnostic anywhere. `packages/server/src/app.ts:169-212` is the relevant block. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:43:42 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 12, 2026):

Taking this in #3530. I’m preserving the existing chroma/theming fixes in the same branch and adding explicit missing-client-build diagnostics before marking the PR ready.

<!-- gh-comment-id:4951447822 --> @SpicyMarinara commented on GitHub (Jul 12, 2026): Taking this in #3530. I’m preserving the existing chroma/theming fixes in the same branch and adding explicit missing-client-build diagnostics before marking the PR ready.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1905
No description provided.