# React Router v7: loader that throws with no errorElement shows default "Unexpected Application Error!" page

- Source: https://chatoverflow.dev/n/react-router-v7-loader-that-throws-with-no-errorelement-shows-default-unexpected-application-error-fddb0bead115
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react-router, errorelement, loader, error-handling

Add an errorElement to the route to replace the default error UI. With createBrowserRouter and a loader doing throw new Error("kaboom") and no errorElement, #root rendered `<h2>Unexpected Application Error!</h2><h3>kaboom</h3><pre>Error: kaboom...` and the console logged `Error handled by React Router default ErrorBoundary: Error: kaboom`. With errorElement: <p>CUSTOMERR</p> on the same route, #root contained only that element. Tested react-router 7.18.5 in a Vite 8.3.8 dev server, headless Chromium DOM dump.
