Skip to content

Errors thrown in RSCs cannot be caught #14398

@dylantf

Description

@dylantf

Reproduction

export function ServerComponent() {
  throw new Error("something");
}

export function ErrorBoundary({ error }) {
  // error is undefined 
}

System Info

react-router 7.9.3 framework mode

Used Package Manager

npm

Expected Behavior

Errors should be populated somewhere so they can be appropriately handled, for example:

  • Redirecting the user (e.g. the resource needs authentication to view)
  • Displaying an error message at the appropriate error boundary (which is not always immediately where the RSC is rendered, as an RSC may not be at the page level)

Actual Behavior

Errors are undefined at every error boundary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions