You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 83783d0
Browse filesBrowse the repository at this point in the historyBrowse files
Reject a specific non-loopback --host in browser dev; restore vp run docs
Single-origin browser dev proxies backend traffic to localhost. A backend
bound only to a specific interface (--host 192.168.1.10) leaves localhost
unanswered, so every proxied request fails in a way that reads as a broken
server rather than an unsupported flag combination. Reject it at startup
with the two working alternatives (wildcard bind, --share). dev:server and
dev:desktop don't proxy and keep specific-interface binds.
Also returns the docs this PR touched to `vp run dev` — vp is this
repo's task runner and forwards --share fine; the `bun run` wording was
introduced by this PR itself responding to a bot nudge, matching neither
main nor the surrounding lines.
Co-Authored-By: Claude Fable 5 <[email protected]>
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
## Dev Servers
17
17
18
18
- In a linked git worktree, dev state defaults to that worktree's gitignored `.t3`. This deliberately outranks an ambient `T3CODE_HOME`, which could otherwise select the installed app's live `~/.t3/userdata` database. An explicit `--home-dir` still wins.
19
-
- Start the web stack with `bun run dev`. Use `bun run dev:share` when someone needs to open it from another device on the tailnet.
19
+
- Start the web stack with `vp run dev`. Add `--share` when someone needs to open it from another device on the tailnet.
20
20
- Browser dev is single-origin: Vite proxies `/api`, `/ws`, `/oauth`, and `/.well-known` to the backend. Do not set `VITE_HTTP_URL` or `VITE_WS_URL` for `dev`/`dev:web`.
21
21
- Worktree paths supply stable preferred port offsets. Read the actual server and web ports from the `[dev-runner]` line because occupied ports can still shift them.
Copy file name to clipboardExpand all lines: docs/reference/scripts.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Scripts
2
2
3
-
-`bun run dev` — Starts contracts, server, and web in watch mode.
4
-
-`bun run dev --share` (or `bun run dev:share`) — Also publishes the web port over HTTPS on this machine's tailnet. The startup pairing URL is built against the shared origin, and the mapping is removed on exit.
3
+
-`vp run dev` — Starts contracts, server, and web in watch mode.
4
+
-`vp run dev --share` — Also publishes the web port over HTTPS on this machine's tailnet. The startup pairing URL is built against the shared origin, and the mapping is removed on exit.
5
5
-`vp run dev:server` — Starts just the WebSocket server. The server process runs on Bun (`@effect/platform-bun` + `BunPtyAdapter`), but task running uses `vp run`.
6
6
-`vp run dev:web` — Starts just the Vite dev server for the web app.
7
7
- Dev commands run from a linked **git worktree** default to that worktree's gitignored `.t3`, even when `T3CODE_HOME` is set, storing state in `<worktree>/.t3/userdata`. Pass `--home-dir <path>` to choose another isolated directory explicitly. Submodules are not worktrees and keep the normal precedence.
* Bind hosts on which a backend still answers `http://localhost:<port>`, which
41
+
* is where single-origin browser dev proxies to. Loopback and the wildcards
42
+
* qualify; a specific interface (e.g. a LAN IP) does not — the OS binds only
return`--host ${this.host} cannot be combined with ${this.mode}: single-origin browser dev proxies the backend at localhost, and a backend bound only to ${this.host} leaves localhost unanswered, so every proxied request fails. Use a wildcard (0.0.0.0 or ::) to serve that interface and loopback together, or --share for remote access.`;
175
+
}
176
+
}
177
+
146
178
exportconstDevRunnerError=Schema.Union([
147
179
DevRunnerConfigurationError,
180
+
DevRunnerHostNotProxiableError,
148
181
DevRunnerInvalidPortOffsetError,
149
182
DevRunnerPortExhaustedError,
150
183
DevRunnerProcessError,
@@ -582,6 +615,19 @@ export function runDevRunnerWithInput(input: DevRunnerCliInput) {
582
615
),
583
616
);
584
617
618
+
// Single-origin browser dev proxies the backend at localhost. A wildcard
619
+
// bind still answers there; a specific non-loopback interface does not,
620
+
// which breaks every proxied request in a way that reads as "server is
621
+
// broken" rather than "flag combination is unsupported". Reject it up
622
+
// front instead. (dev:server and dev:desktop don't proxy — untouched.)
0 commit comments