SSR: an error thrown inside <Suspense> rejects renderToReadableStream instead of falling back to client rendering
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- react, typescript
Rechercherichtung
Start with the SSR implementation of renderToReadableStream and trace how errors from synchronous throws and rejected lazy imports are handled within Suspense boundaries. Compare the emitted output and onError behavior with the React examples in the issue. Done means both cases report the error, mark the failing boundary for client rendering, and allow the rest of the stream to resolve.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Version: @tanstack/redact 0.2.0 (compared with react-dom 19.2.0)
When a component throws during SSR inside a <Suspense> boundary, Redact's renderToReadableStream rejects the whole stream. React instead reports the error to onError, marks that boundary for client rendering (<!--$!-->), and still resolves the stream.
With TanStack Start, the whole page then returns 500, where React would have degraded only that boundary. We hit this when a third-party module threw at evaluation time inside a code-split route: React had been hiding the error, and Redact turned it into a 500.
Repro: https://github.com/ryoppippi/tanstack-redact-ssr-suspense-error-repro (pnpm install && node repro.mjs)
<html><body>
<Suspense fallback={<p>loading</p>}>
<Throws /> {/* throws during render */}
</Suspense>
</body></html>
react | sync throw | ok | onError=["render error inside Suspense"] | <!DOCTYPE html><html><head></head><body><!--$!--><template data-msg="Switched to client rendering because the server ren
react | lazy reject | ok | onError=["lazy chunk failed to evaluate"] | <!DOCTYPE html><html><head></head><body><!--$!--><template data-msg="Switched to client rendering because the server ren
redact | sync throw | REJECTS | onError=["render error inside Suspense"] | render error inside Suspense
redact | lazy reject | ok | onError=["lazy chunk failed to evaluate"] | <!DOCTYPE html><html><head></head><body><!--$?0--><div id="B:0"><p>loading</p></div><!--/$--></body></html>
The repro also has a related case: when a lazy() import rejects, Redact resolves the stream but leaves the boundary pending (<!--$?0--> plus the fallback). React marks it for client rendering instead.
Expected: match React. Call onError, emit the client-render marker for the failing boundary, and keep streaming the rest of the document.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 537
- Forks
- 22
- Ø Merge
- 1 Std. 57 Min.
- Gemergte PRs (30 T.)
- 20
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/redact
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
TanStack/redact#67 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TanStack/redact
Ähnliche Issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 61/100
lingdojo/kana-dojo#33465 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
opensheetmusicdisplay/opensheetmusicdisplay#1885 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Time zone picker still shows America/Winnipeg as -06:00 after Manitoba’s move to permanent UTC-5Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
home-assistant/frontend#55537 ·
Maintainer antworten meist innerhalb von 1 Tag
-
What's New sheet: inline rows join title and summary with no space in copied/accessibility textOffenneeds-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
manaflow-ai/cmux#31347 ·
Maintainer antworten meist innerhalb von 1 Tag