fix: detect fetch-blocked ports up front instead of failing every check - #99
Merged
Conversation
Node's fetch (undici) implements the WHATWG bad port list and refuses requests to those ports before they reach the network, so running afdocs against a dev server on e.g. 1719 failed every check with a bare "fetch failed". Vendor the list, fail fast in createContext with an error naming the port and safe alternatives, and print runner errors cleanly from the CLI instead of an unhandled rejection. Closes #97
dacharyc
force-pushed
the
fix/blocked-port-preflight
branch
from
August 9, 2026 02:29
e522db9 to
380acc9
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.
Summary
src/helpers/blocked-ports.tshelper (undici implements the list but does not export it)createContextwhen the target URL's port is on the list, with an error naming the port and suggesting safe alternatives, instead of thirteen opaque "fetch failed" check resultscheckcommand and print them cleanly (previously a thrown runner error surfaced as an unhandled rejection)docs/run-locally.mdto reflect that the tool now diagnoses this directlyCloses #97
Test plan
isBlockedPort/getBlockedPort/blockedPortMessageand forcreateContextthrowing on blocked portsnpm test(1304 tests),npm run lint, prettier cleanafdocs check http://localhost:1719exits 1 with the actionable error; safe ports unaffected