How to handle unexpected errors thrown within the root layout in a Next 14 application? #65196
-
SummaryI want to handle unexpected errors in my Next 14 application. My goal is to have a global error fallback UI that will handle all errors thrown within my root layout. Based on the documentation, I could create a global error file inside my app directory which is responsible for handling all unexpected errors. My project directory looks like the following: While my global error page component: For testing purposes, I threw an error inside my About page. I expected the global error page component to get executed and replace the root layout. Instead, I got the following: Am I doing something wrong? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Is the problem, perhaps, that the About page is in another route group? |
Beta Was this translation helpful? Give feedback.
Could you just verify one more thing?
In the docs it also says:
Could you build, your app, and try again?