Repository navigation
Description
Follow-up to #36409. Its startup retry was merged in #26451, but the Mac mini/Tailscale Serve connection resets still reproduce on stable 0.1.12.
Area
apps/web, apps/server (headless packaged server via Tailscale Serve)
Steps to reproduce
- Run the packaged T3 Code server on Apple silicon macOS, bound to loopback, and expose it on a private HTTPS port with Tailscale Serve.
- Open its web app in Chrome on another Mac over the same tailnet.
- Use Chrome's normal Reload button on an existing draft. It can display the startup error even though the previous load rendered the draft.
Expected
Normal reload opens the same draft reliably without manual hard reloads.
Actual
On 0.1.12 the browser displayed Unable to preload CSS for /assets/main-DYJdcEdq.css. In that same second, the Tailscale system extension logged 49 reset errors on the loopback connection to the T3 server. A later individual request for the exact CSS through the same HTTPS endpoint returned 200. The T3 process did not need to restart for the asset to become reachable.
Environment
- T3 Code 0.1.12 stable, headless CLI; also observed on 0.1.10.
- Mac mini, Apple silicon, macOS 27.0.
- Tailscale Standalone 1.104.2, HTTPS Serve forwarding to
127.0.0.1:3773. - Chrome 158 on another Mac.
kern.ipc.somaxconnis 128. I did not capture a full listen queue at the failure instant; queue saturation is consistent with Web UI fails to start through Tailscale Serve on macOS: the startup chunk burst overflows the server's listen queue #36409, not proven by this sample.
Relevant log (sanitized)
HTTP 502 on static assets
Unable to preload CSS for /assets/main-DYJdcEdq.css
http: proxy error: dial tcp 127.0.0.1:3773: connect: connection reset by peer
Suggest tracking the remaining startup request burst separately from the retry behavior. #36427 is a related unmerged reduction in startup JS requests; this report is a real macOS/Tailscale reproduction on the stable build.
Local mitigation (not an upstream fix)
A loopback-only shim on the existing private Serve origin handles only /assets, keeping application and WebSocket routing direct. It reuses at most 24 connections to T3. At a larger test size this initially moved some resets to the shim's listener (278 HTTP 200 / 22 HTTP 502). After raising only the shim job's file-descriptor allowance, the same 300 static requests on one HTTP/2 connection returned 300 HTTP 200 in one run. No system TCP setting or T3 authentication change was involved. The experiments do not establish which local kernel/resource limit triggered the original burst.
Activity
juliusmarminge commentedon Nov 25, 2026
I tried to reproduce this on the current build and could not.
Commit f99eceb (origin/main) and the published v0.1.12 darwin-arm64 CLI archive, on a pool Mac (macOS 26, Apple silicon, kern.ipc.somaxconn=128). (1) Built apps/web on main and ran
T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --port <p> --host 127.0.0.1 --base-dir <fresh>. (2) Unpacked t3-0.1.12-darwin-arm64.tar.gz and rant3 serveon loopback with a fresh base dir. (3) Put each behind an HTTPS/HTTP2 reverse proxy that dials a fresh TCP connection to the backend per request (as Tailscale Serve's Go proxy does), and drove headless Chromium via Playwright: fresh loads, then normal page.reload() in one context. Findings: the 0.1.12 client/ has no .vite/manifest.json, and the server serves /assets/main-DYJdcEdq.css (the exact file in the report) withcache-control: no-cache, while main's source build serves the same kind of assetpublic, max-age=31536000, immutable. Requests per load through the proxy: 0.1.12 first load 234, every normal reload 232-233 (5/5); main build first load about 232, reloads 7-12 (10/10). So on released builds every normal reload re-sends the full startup burst. The final symptom (502 / connection reset / 'Unable to preload CSS' boot error) did not appear: 0 dial errors and 0 boot errors across 22 loads, and even 1000 synchronous TCP connects to the idle server were all accepted (listen queue 0/0/128). Overflowing the queue likely needs real Tailscale Serve and a busy server, which were not available.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
spa5k commentedon Nov 26, 2026
Still reproduces on 0.1.12 stable. Here is a repro against real Tailscale Serve that doesn't need a browser.
Setup: T3 Code desktop 0.1.12 stable, macOS 27.2.1 on Apple silicon, server on
127.0.0.1:3773. Tailscale Standalone 1.104.7,tailscale serveHTTPS:44441->http://127.0.0.1:3773. Clients: a Safari 27.2 Dock web app and Helium (Chromium) on another Mac on the same tailnet.Browser symptom: "T3 Code failed to start / TypeError: Importing a module script failed" on nearly every launch. A Chromium HAR shows 49
/assets/*.jsresponses and 1 CSS response as 502 with an empty body (content-length: 0) from the Serve endpoint. The other 172 assets were 200.Repro (run on the host, curl 8.7.1): all 413 JS assets referenced by the entry and main chunks, fetched in parallel:
127.0.0.1:3773directThe results vary between runs: one run at 200 had only 5 × 502. Failures always started somewhere between 100 and 200 concurrent requests.
This doesn't look like listen-queue overflow, at least here:
netstat -s -p tcpreports0 listen queue overflow(and0 embryonic connection dropped) both before and after the failing runs, withkern.ipc.somaxconn= 128. Direct loopback handles 400 concurrent connections without errors. The failure seems to be in Serve's proxy path once there are roughly 200+ concurrent upstream requests. That matches your finding that a generic proxy doesn't reproduce it.Why it happens on every launch: 0.1.12 serves the hashed
/assets/*files withcache-control: no-cacheand a weak ETag, so every launch revalidates the full burst of about 400 requests (the server log here shows mostly 304s). Your note thatmainalready servespublic, max-age=31536000, immutableshould fix repeat loads once it's released. First loads will still hit the burst, and so will new devices and Safari Dock web apps (they have separate storage from Safari). Capping concurrent module preloads or bundling fewer startup chunks would cover those cases.The single automatic reload from #26451 doesn't help much here: with this many requests failing, the retry rarely gets every startup chunk either.