-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
chore: react-server (dynamic ssr and rsc) error handling e2e tests #1112
chore: react-server (dynamic ssr and rsc) error handling e2e tests #1112
Conversation
Browser back button and dynamic rendering with suspense errors
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
We need a test case for fs router that calls a server function that throws. I think that will demonstrate the default |
Does this also happen with just createPages? Or is it specific to fs-router? |
Ah right... the server function errors hit the ErrorBoundary for the Router component ( edit: I'll try adding a test to create-pages.spec.ts. |
84ee3d5
to
99fed9d
Compare
I added tests in 99fed9d. The create-pages.spec.ts tests pass since they demonstrate the current behavior. |
Here are the remaining failing tests that I added: create-pages.spec.ts:91 › server function unreachable rsc-basic.spec.ts:74 › server handle network errors ssr-catch-error.spec.ts:41 › navigate back after invalid page through client router |
Should we fix it for the expected behavior?
I'm currently working on this. This requires to change the way how we code. But, this is something I've been wondering, and the outcome will be more reasonable. I'll check out other cases later. Thanks so much for helping this. |
Yes, we should. With the The error seems to happen outside the layout/page render trees so it doesn't hit any of the developer defined error boundaries. I think we need a way to pass an ErrorBoundary into the |
Hm, maybe I should work on the create-pages one first. |
8fa1216 @rmarscher Can you check it? If you want to show the error boundary, you should "throw" the error in render instead of displaying.
Note that server actions are not part of rendering, so it's not something to catch.
Yeah, keep this mind and we should tackle it later. |
@rmarscher I haven't received your review yet, but this is done. I'll merge it anyway, but feel free to review, discuss, and ask questions if any. Two remaining things:
I'll work on 2 first. |
Both remaining tasks should be done in #1122. |
Oh great. Sorry I missed reviewing the other updates. I'll take a look. Thank you! |
The additional ErrorFallback and Suspense examples seem to work well.
The tests I added for using the browser back button and for throwing an exception from a server function are failing though.
ref: #967