-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Global error handler (global-error.tsx) fails to catch errors in nested layouts #50119
Comments
For me it doesn't catch error from root layout either |
Still seeing this issue after upgrading to v13.4.10. Unable to catch errors from root layout. Only from root |
Same here, updated to 13.4.10 and throwing an error in root layout does not display |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023 Binaries: Node: 16.17.0 npm: 8.15.0 Yarn: 1.22.19 pnpm: 7.1.0 Relevant packages: next: 13.4.4-canary.0 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/runtime-water-ylwcg0
To Reproduce
Describe the Bug
After upgrading to version v13.1.7-canary.11 and newer, the global error handler (global-error.tsx) fails to catch errors that occur within nested layouts. When an error occurs in a layout, the global error handler is not triggered, and the error is not handled.
Expected Behavior
When any error occurs in the application, the global error handler (global-error.tsx) should be triggered regardless of the level of nesting in the layouts. The global handler should catch and handle errors at any level of layout nesting.
Same as was in 13.1.7-canary.10.
codesandbox with 13.1.7-canary.10: https://codesandbox.io/p/sandbox/crazy-lake-nw0qy7
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: