mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #989] Handle falsy thrown values in error boundaries (e.g. throw undefined) #214
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#214
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 30, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/989
Upstream change
Next.js fixed falsy-value handling in client error boundaries in vercel/next.js#93134 (commit ea54198).
Files changed upstream
packages/next/src/client/components/catch-error.tsxpackages/next/src/client/components/error-boundary.tsxpackages/next/src/client/components/http-access-fallback/error-boundary.tsxpackages/next/src/client/components/redirect-boundary.tsxpackages/next/src/client/components/nav-failure-handler.tspackages/next/src/next-devtools/userspace/app/app-dev-overlay-error-boundary.tsxpackages/next/src/next-devtools/userspace/pages/pages-dev-overlay-error-boundary.tsxWhy this matters for vinext
vinext reimplements the App Router error boundary chain (error boundary, redirect boundary, http-access-fallback boundary) for both the RSC and SSR environments. If we use the same
state.error = error; if (state.error)pattern, we will also:childreninstead of the fallback UI when something throws a falsy value (throw undefined,throw null,throw 0,throw '',throw false)This is related to issue #810 (Don't swallow strings thrown in Server Components) but covers the broader falsy-value case in client-side error boundaries.
Action
if (state.error)truthiness checknull(no error) or{ thrownValue: unknown }(errored), matching upstreamtest/e2e/app-dir/catch-error/,test/e2e/app-dir/errors/,test/e2e/app-dir/global-error/basic/) forthrow null/throw undefinedfrom both client and server componentsReferences
github.com/vercel/next.js@ea541987d1