-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
A frustrating behavior of the router:
https://github.com/rackt/react-router/blob/master/modules/Transition.js#L60
If you have any errors in your component mounting / instantiating, they are eaten by the router. All you'll get in the console is something like "Undefined is not a function" but no stack trace. I believe this is because the mount* functions get called synchronously, so when that code calls callback
it triggers the React land component stuff, and any errors are caught by the try catch
. The error eventually gets thrown here:
This makes it very hard to debug errors in component instantiation.
This can be reproduced very simply by making a component with a willTransitionTo
that has a runtime error either in the willTransitionTo
or in the render
.