A request aborted by the client is logged as an unhandled 500
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #8536 @mixelburg による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
Start with executeMiddleware in packages/start-server-core/src/createStartHandler.ts around lines 413, 436, and 475, then trace the rejection through requestHandler in packages/start-server-core/src/request-response.ts around lines 121-143. Reproduce the behavior with a delayed loader, a built server, and curl -m 0.2. Done means a client-aborted request ends quietly without the unhandled error log or a server-side 500 response.
索引モデルが issue の本文から書いたものです。
説明
What happens
When a client closes the connection while a request is still running, Start prints the abort reason as an unhandled error on the server, with status 500:
Error: aborted
at abortIncoming (node:_http_server:921:17)
... 2 lines matching cause stack trace ...
at TCP.<anonymous> (node:net:362:12) {
cause: Error: aborted
at abortIncoming (node:_http_server:921:17)
at socketOnClose (node:_http_server:914:3)
at Socket.emit (node:events:526:24)
at TCP.<anonymous> (node:net:362:12) {
code: 'ECONNRESET'
},
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
Nobody receives the 500, because the client has gone. In production, every user who navigates away while a loader or server function is waiting prints one of these. It cannot be caught from application code. A request middleware that catches the abort and returns its own Response still gets the line, and so does a custom src/server.ts that wraps handler.fetch in a try/catch, because the error never leaves handler.fetch. Start returns a 500 Response and logs it on the way.
Why
- Once
request.signalaborts,executeMiddlewarethrowssignal.reasonwhatever the middleware returned:createStartHandler.tsL413, L436, L475. requestHandlerpasses the rejected promise to h3'stoResponsewith no config:request-response.tsL141.- h3's
prepareResponsetreats anything that is not anHTTPErroras unhandled, logs it withconsole.errorunlessconfig.silentis set, and answers 500.
The reason is whatever the server runtime aborts the signal with. Under srvx it is Node's socket error (Error: aborted, ECONNRESET). An AbortError would be logged the same way, since it is an Error and not an HTTPError.
This is close to #8155, which fixed the SSR render stream surfacing the same abort. That path is fixed in our versions. This one is the middleware runner's throw, which reaches h3 whatever the render does.
Steps
- A route whose loader calls a server function that waits for a few seconds, for example an upstream call with a long deadline.
vite build, then start the built server.curl -m 0.2 http://localhost:3000/<that route>, so the client leaves while the loader waits.- The server prints the error above. In our app the request middleware's own log line records the request as a 499 with
aborted: truejust before it, so the app did see the abort.
Expected
A request the client aborted ends quietly. Two possible shapes: requestHandler answers a bare response without calling h3 when request.signal.aborted and the rejection is request.signal.reason, or it passes h3 an onError that does the same.
Versions
@tanstack/react-start1.168.56 (1.168.58 is the same: it depends on the same server core)@tanstack/start-server-core1.169.37 (latest).mainat3cdd1af04bhas the same code.h3-v2([email protected]), bundled by Startnitro3.0.260903-beta vianitro/vite,srvx1.0.3- Node 24.21.0, macOS
- 主要言語
- TypeScript
- スター
- 15.3k
- フォーク
- 1.9k
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 46
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/router のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')対応中かも @hassanabrar202 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)対応中かも @Sheraff が 27 日前に担当しました。 オープンpackage: router-generator performance
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiers対応中かも @Sheraff が 27 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
docs(router): clarify static title fallback in SPA mode対応中かも @Rohan-Dedhia が 17 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
TanStack/router の issue をすべて見る
似ている issue
-
[BUG]: Shared links drop the configured basePath on GitHub Pages対応中かも @anshulchikhale30-p が今日担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add: GTrekkerオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
メンテナーはふだん 1 日以内に返信
-
area: ui Bug Payload OSS
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
payloadcms/payload#19839 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
メンテナーはふだん 1 日以内に返信