Start: serverFnFetcher unconditionally console.logs every server-function error, including benign cancellation AbortErrors
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
Inizia in packages/start-client-core/src/client-rpc/serverFnFetcher.ts, in getResponse, e ispeziona il blocco catch che registra gli errori che non sono Response. Usa la riproduzione collegata e i passaggi per l'annullamento per verificare il comportamento. Il lavoro è completato quando gli errori delle funzioni server rilanciati, inclusi gli AbortErrors, non producono più il log estraneo nella console.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Which project does this relate to?
Start
Describe the bug
serverFnFetcher's getResponse logs every non-Response error thrown by a server-function call via console.log, then re-throws it. In packages/start-client-core/src/client-rpc/serverFnFetcher.ts:
async function getResponse(fn) {
let response
try {
response = await fn()
} catch (error) {
if (error instanceof Response) response = error
else {
console.log(error) // ← logs every error, incl. benign cancellations
throw error
}
}
// ...
}
Two problems:
- It's unconditional — there is no
process.env.NODE_ENVguard, so it also runs in production builds (bundlers don't stripconsole.logby default), spamming the browser console for real users. - It logs benign cancellations. When a caller passes an
AbortSignalto a server function and aborts it (e.g. a request cancelled on navigation/unmount), the RPCfetchrejects withDOMException: signal is aborted without reason(AbortError).getResponseconsole.logs it and re-throws. The
re-thrown error is then handled by the caller (who deliberately aborted and no longer cares about the result), so the throw itself is fine — but theconsole.logleaves a stray, stack-trace-bearing console entry with no context.
Because it's console.log (not console.error) on a caught-and-rethrown error, it can't be intercepted from application code: it never reaches a framework error hook or error boundary, and it isn't an unhandled promise rejection, so a window unhandledrejection listener doesn't catch it either.
The only app-side workarounds are monkey-patching console or patching the package.
Complete minimal reproducer
https://codesandbox.io/p/devbox/condescending-diffie-z59y9f
Steps to Reproduce the Bug
- Start Dev Server
- Open preview browser.
- Click the button
- examine browser dev console logs
Expected behavior
Cancelling a server-function call should not log to the console. More generally, getResponse should not console.log errors it re-throws — the caller is responsible for handling and reporting them. At minimum the log should be removed; if diagnostic logging is intended, gate it behind
process.env.NODE_ENV !== 'production' and skip cancellation errors (AbortError / CancelledError).
Screenshots or Videos
No response
Platform
@tanstack/react-start1.168.30 (@tanstack/start-client-core1.170.13)- React 19, Vite 8
- Browser: Chrome (reproduces in both dev and production builds)
Additional context
No response
- Lingua principale
- TypeScript
- Stelle
- 15.1k
- Fork
- 1.9k
- Merge medio
- 1g 19h
- PR unite (30g)
- 136
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/router
-
information needed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
lazyRouteComponent reload guard key collides on Safari, capping stale-deploy recovery at one per tab Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
information needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Tutte le issue di TanStack/router
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fullcalendar/fullcalendar#8106 ·