SSR: an error thrown inside <Suspense> rejects renderToReadableStream instead of falling back to client rendering
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 537
- Fork
- 22
- Merge trung bình
- 1 giờ 57 phút
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/redact
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
TanStack/redact#67 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/redact
Issue tương tự
-
Add: Class TV ModaĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
GiganticMinecraft/seichi-playguide#183 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: core complexity: easy impact: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ueberdosis/tiptap#8668 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
longbridge/nsh#804 ·
Maintainer thường phản hồi trong vòng 1 ngày