Repository navigation
docs(portal): say why the prerender fetch reaches the IPv4 bind - #349
Draft
mrafnadeem-apimatic wants to merge 1 commit into
Draft
mrafnadeem-apimatic wants to merge 1 commit into
mrafnadeem-apimatic wants to merge 1 commit into
Conversation
TanStack Start fetches prerendered pages from the preview server's `resolvedUrls.local[0]`, not a hard-coded `localhost`. Vite builds that URL from the configured host, so `host: '127.0.0.1'` pins the fetch target as well as the bind. The previous comment implied only the bind was constrained. Caught by https://github.com/apimatic/apimatic-cli/actions/runs/35822824551 (macos-latest / Node 24: `connect ECONNREFUSED 127.0.0.1:49193` in prerenderPages). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
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.



Follow-up to the review on a404e3f (
preview: { host: '127.0.0.1' }, shipped in #347).Both ends are already pinned
The review was concerned that the fetch target is still
localhostand gets resolved inside TanStack Start. It isn't.@tanstack/start-plugin-core1.171.40 (dist/esm/vite/prerender.js) startsvite.preview({ port: 0 })and fetches every page frompreviewServer.resolvedUrls.local[0]. Vite 8.2.2 (resolveHostname/resolveServerUrls) builds that URL from the configured host. When the host is a literal loopback address it is used as is, with no DNS lookup. Thehttp://localhoststrings inprerender.jsonly parse relative page paths and never reach the network.I ran
vite.previewon this checkout:preview.hostresolvedUrls.local::1http://localhost:<port>/'127.0.0.1'127.0.0.1http://127.0.0.1:<port>/So on an IPv6-only host the fetch fails the same way the bind does: it's a clean, deterministic listen error, not a mismatch that Happy Eyeballs has to rescue. TanStack Start has no option to set the prerender origin, and we don't need one.
Change
This PR changes only the comment. The old text ("binding IPv4 leaves the fetch a single address to reach") read as though the bind indirectly narrowed the fetch. The new text says why both ends match: the fetch uses the preview server's first local URL, which Vite builds from the same literal host.
The run that caught it
https://github.com/apimatic/apimatic-cli/actions/runs/35822824551, macos-latest / Node 24:
Error: connect ECONNREFUSED 127.0.0.1:49193inprerenderPages. That run used the default host, so the server was on::1. The link is also in the commit body, so a recurrence can be checked against it.🤖 Generated with Claude Code