-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Failing test for recoverable error when new, unrelated Suspense boundaries commit #32436
base: main
Are you sure you want to change the base?
Conversation
const [state, setState] = React.useState(false); | ||
renderSuspense = () => setState(true); | ||
|
||
return state ? <Suspense /> : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new Suspense boundary triggers the error. If we start out with return <Suspense />
no error is triggered.
<Page /> | ||
</Suspense> | ||
</ErrorBoundary> | ||
<Sibling /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're triggering an update in the <Sibling>
tree long after <ErrorBoundary>
committed yet we still get the "switched to client-side rendering" from the <ErrorBoundary>
tree.
Comparing: 70f1d76...b117d40 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
5ae5713
to
9d1a228
Compare
expectErrors( | ||
errors, | ||
[ | ||
[ | ||
'Switched to client rendering because the server rendering errored:\n\n' + | ||
theError.message, | ||
expectedDigest, | ||
componentStack(['Page', 'Suspense', 'ErrorBoundary', 'App']), | ||
], | ||
[ | ||
'Switched to client rendering because the server rendering errored:\n\n' + | ||
theError.message, | ||
expectedDigest, | ||
componentStack(['Page', 'Suspense', 'ErrorBoundary', 'App']), | ||
], | ||
], | ||
[ | ||
[ | ||
'The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.', | ||
expectedDigest, | ||
], | ||
], | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no errors here since we updated an unrelated tree. That particular error was already handled by committing the error boundary.
9d1a228
to
0c0218a
Compare
Summary
Found these when working on the Next.js error overlay.
How did you test this change?