-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[Bug]: Unhandled exception in the data loader does not print the stack trace to the console #10282
Comments
You're getting the stack in the UI (in dev mode) though right? You just also want it in the console for clickable source links? |
Yes, that is right. The stack renders inside the default |
Fixed by #10286. This will be available when React Router 6.11 is released. |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of React Router are you using?
6.9.0
Steps to Reproduce
Use the example:
In this example, there is a bug in
homeLoader
that throws an unhandled exception.This exception causes the
errorElement
to render (good and expected) but the error itself is never printed to the JavaScript console usingconsole.error
or similar.I consider this a bug as the docs say:
https://reactrouter.com/en/main/route/error-element
I understand this mean the error should be printed to the console. Errors that occur during rendering (instead of in the loader) do print to the console as expected.
Printing the error to the console would improve the developer experience for debugging and testing.
Expected Behavior
The unhandled error in the loader is printed to the JavaScript console with its stack trace.
Actual Behavior
The unhandled error does not appear not JavaScript console.
The errorComponent does render.
The text was updated successfully, but these errors were encountered: