Repository navigation
fix(server): serve the static build output in the production server - #47
Merged
Merged
Conversation
scotwells
previously approved these changes
Oct 28, 2026
ecv
force-pushed
the
polylane/autofix/0ai4phm0azs1
branch
from
November 9, 2026 13:14
8e0db96 to
68febe4
Compare
scotwells
approved these changes
Nov 9, 2026
Co-authored-by: polylane[bot] <277585245+polylane[bot]@users.noreply.github.com>
ecv
force-pushed
the
polylane/autofix/0ai4phm0azs1
branch
from
November 9, 2026 13:26
68febe4 to
8df450e
Compare
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.
The production server this project ships could not start. The site builds as a static bundle, but the server expected a server-rendered build and stopped on its first import, so nothing was served on port 4321 for anyone running the documented production path. After this change the server serves the built site and returns the project's own 404 page for unknown paths.
Fix walkthrough
Watch the fix explained (1:17). Recorded for commit
68febe43bab60a476402fe79bb3aa4517125404b.Detection evidence
Affected:
int_17ad4b457001o98datdn4tkmWhy this fix
The declared production entrypoint imported a bundle the static Astro build never emits, and I reproduced the crash locally. Testing the alternative fix showed that restoring the node adapter moves prerendered pages under a subdirectory and drops
index.htmlfrom the artifact root, which would break the GitHub Pages deploy that serves the live site. The remaining failure is thatbun run builditself still breaks on an unrelated dependency-resolution defect, tracked separately.Out of scope
@astrojs/nodedependency:bun removealso downgraded an unrelated transitive package inbun.lock, so I left that for a separate dependency change.js-yamlbuild failure that blocksbun run buildanddocker build: a separate dependency-resolution defect, tracked separately.Production impact: Server serves the same built files it always intended to
The cloudvalid.com repository has no deploy edges in the infrastructure graph: no workflow builds its Docker image, and production is GitHub Pages. The changed file is not read by that Pages build. I verified the change locally against a built static site:
/,/docs, and assets return 200 and an unknown path returns the prerendered 404 page.Observability
server.mjsstartup banner prints which subsystems are enabled.NODE_ENVunset it logs one line per request ([timestamp] METHOD url); in production that log is suppressed by design.Polylane assessed this pull request at
8e0db96.Causal chain
astro buildwrites pages at the dist root and emits neither dist/server/entry.mjs nor dist/client; server.mjs imports ./dist/server/entry.mjs at line 2 and reads dist/client at line 13, so the process throws before listening.bun run ./server.mjsexits 1 with Cannot find module './dist/server/entry.mjs'.Generated by Polylane. You can ask follow-ups by mentioning @polylane in a comment.