mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #810] Don't swallow strings thrown in Server Components #179
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#179
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (Apr 10, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/810
Next.js Change
When a string (or other non-Error value) is thrown in a Server Component, Next.js previously had a code path in
createReactServerErrorHandlerthat returned early with a hash digest, effectively swallowing the thrown value before it could be wrapped into a proper Error and logged.The fix moves the string-handling branch into the
elseclause alongside the normal error digest assignment, so thrown strings are first wrapped into an Error object (by React) and then assigned a digest. This ensures:Upstream commit: vercel/next.js@b9ca95c62d
Upstream PR: https://github.com/vercel/next.js/pull/92592
Relevance to vinext
vinext reimplements the RSC rendering pipeline including error handling in the App Router server entries (
entries/app-rsc-entry.ts,server/modules). If vinext has an equivalentonErrorhandler forrenderToReadableStreamor the RSC stream that handles thrown values, it needs to ensure:Action
entries/app-rsc-entry.tsor related server code) has an early-return path fortypeof thrownValue === 'string'that could swallow the value