fix(react-router): use onShellError to destroy stream on unrecoverable SSR errors#7083
fix(react-router): use onShellError to destroy stream on unrecoverable SSR errors#7083mixelburg wants to merge 1 commit intoTanStack:mainfrom
Conversation
…eam on unrecoverable SSR errors
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size Benchmarks
Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better. |
|
View your CI Pipeline Execution ↗ for commit 70a6776
☁️ Nx Cloud last updated this comment at |
Fixes #7078
React's
renderToPipeableStreamcallsonErrorfor all errors — both recoverable (caught by Error Boundaries) and unrecoverable. The previous implementation destroyed thePassThroughstream inonError, which meant:defaultErrorComponentonShellReadyfires normally with the error UI in the shellonErroralso fires →stream.destroy()kills the already-piping streamFix: Follow React's recommended pattern:
onError: logging only, no stream destructiononShellError(new): handle unrecoverable shell render failures withstream.destroy()onShellErrorfires only when React cannot produce any HTML at all — the true unrecoverable case.Summary by CodeRabbit