Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a recoverable error whenever hydration fails #23319

Merged
merged 1 commit into from
Feb 17, 2022

Commits on Feb 17, 2022

  1. Log a recoverable error whenever hydration fails

    There are several cases where hydration fails, server-rendered HTML is
    discarded, and we fall back to client rendering. Whenever this happens,
    we will now log an error with onRecoverableError, with a message
    explaining why.
    
    In some of these scenarios, this is not the only recoverable error that
    is logged. For example, an error during hydration will cause hydration
    to fail, which is itself an error. So we end up logging two separate
    errors: the original error, and one that explains why hydration failed.
    
    I've made sure that the original error always gets logged first, to
    preserve the causal sequence.
    
    Another thing we could do is aggregate the errors with the Error "cause"
    feature and AggregateError. Since these are new-ish features in
    JavaScript, we'd need a fallback behavior. I'll leave this for a
    follow up.
    acdlite committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    dc85597 View commit details
    Browse the repository at this point in the history