-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
More info about error: [mobx] An uncaught exception occurred while...
#462
Comments
Another helpful note, be sure that you don't have both a This is common during refactoring code, and will cause this error. Removing the duplicate definition should resolve it. |
Heh nice one. Isn't the double declaration not picked up by lint / flow / Op vr 14 okt. 2016 om 04:07 schreef Eric Clemmons <[email protected]
|
@mweststrate It seems our ESLint rules (based on those from AirBnB) don't see duplicate class properties as a problem. Anyway, thought it was an interesting edge-case, but it's definitely user-error. |
@mweststrate We just deployed a larger project using Mobx but given the complexity, also have higher amount of exceptions. We're using Bugsnag for exception tracking but unfortunately |
@jorilallo In principle that shouldn't happen, there is no error catching in MobX, only cleanup in |
@mweststrate sure, I'll give it a try |
working on it |
This issue further elaborates on the above error, fee free to comment, but note that comments might be cleaned up after discussing
This error signals that an exception is thrown from a reactive function. The exception is not thrown by MobX itself, but from your own code in for example the
render()
method of an@observer
component, the computation of of a@computed
value or the function you passed to a reaction likeautorun
.Allowing an exception to escape from these methods might lead to unwanted behavior; although MobX in general will continue to work, the throwing method will not be further tracked or automatically run by MobX. So avoid these situations.
The logged message is just a warning that an exception did happen, however it is not the cause. The causing exception is rethrown and should be printed in the log, unless other code (unrelated to MobX) catches the exception.
To get an idea, in MobX handling in exceptions roughly looks like:
In other words, if
fn()
throws; if you will see this message, but it is the symptom of an uncaught exception, but not cause nor the handling of the exception. So you the real exception should end up in your logs directly after this warning, unless the exception is eaten, for example by thecatch
clause of a promise.The text was updated successfully, but these errors were encountered: