I 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?