fix(web): browser tests no longer pick a port Windows has reserved#24007
Problem
apps/web/vite.config.ts hashes the checkout path into a browser-test API port
between 61000 and 64999. On Windows that band sits inside the dynamic port range,
where Hyper-V, WSL and Docker reserve blocks of ports (netsh interface ipv4 show excludedportrange protocol=tcp). If a checkout's path hashes into one of those
blocks, no browser test can run there. Vitest exits at startup with
listen EACCES: permission denied ::1:64580. strictPort: false doesn't help,
because Vite only tries the next port on EADDRINUSE.
Change
Move the band to 20000-23999. It sits below the Linux (32768+) and Windows/macOS
(49152+) ephemeral ranges and clear of dev-runner's ports. Same hash, same width.
If something already listens on the chosen port, strictPort: false still moves on
as before.
Scope and approval
Small, focused fix for an obvious bug: one constant in a dev-only config. Users and shipped code are unaffected.
Verification
Windows 10 (19045), Node 26.12.1, Vite+ 1.3.0. One of my checkouts hashes to 64580, which falls in a reserved block (64537-64636) on this machine.
- Before, from
apps/webin that checkout:vp test run --project browser src/components/ChatMarkdown.browser.test.tsxfails at startup withEACCES ::1:64580. No tests run. - After, same checkout and command: the port is 23580, the browser starts and all 6 tests run. Five pass. The sixth is an unrelated Windows-only failure, fixed separately in #24006.
vp run check:changed: format, lint, knip and typecheck (2 packages) pass. On Windows this needed a local workaround forcheck:changedspawningvp.cmd, which isn't part of this PR.
Not checked on Linux or macOS. The new band is outside their ephemeral ranges, and a port already in use is handled the same way as before.
Fix written by Claude Opus 5.5 in Claude Code (T3 Code).
š¤ Generated with Claude Code
Checks
Added 1 commit
- fix(web): browser tests no longer pick a port Windows has reserved3f5dad7
Approvability
Verdict: Approved at 3f5dad7
Macroscope's review found this PR approvable ā This is a small, isolated browser-test configuration fix that moves the hashed test API port below OS ephemeral and reserved-port ranges. It affects only local test execution and does not change shipped product behavior or product defaults.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. š
ā¹ļø Recent review info
āļø Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 807319c
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cdffac87-6fda-4f9b-90b9-c042b7dbc8cb
š„ Commits
Reviewing files that changed from the base of the PR and between 807319c276c6831b2c219640e9da5b38019a8f1d and 3f5dad74ed2c9a1039be09db3df5a15c78d8b8f4.
š Files selected for processing: 1
apps/web/vite.config.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
š Walkthrough
The browser test API port range changes to 20,000ā23,999. Port selection continues to use the checkout-path hash.
Changes: Browser test API port selection
Layer / File(s) Summary Update the browser test API port range
apps/web/vite.config.tsThe configured range changes from 61,000ā64,999 to 20,000ā23,999. The checkout-path hash calculation remains unchanged. Priority: ā Normal
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: āŖ Minimal Ā· up to 3f5da
No actionable merge-blocking risk remains in this dev-only configuration change.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title is concise, specific, and uses the required conventional commit format. It accurately describes the Windows browser-test port fix. Description check Passed The description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the Windows failure, the port-range change, scope justification, focused before-and-a⦠Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Full details: Description check
Explanation
The description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the Windows failure, the port-range change, scope justification, focused before-and-after verification, related test status, unverified platforms, and the agent used.
⨠Finishing Touches
š§Ŗ Generate unit tests (beta)
- Create a new PR
- Autofix Ā· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.