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
Better assertAlive error (show name of invoked action or accessed field) #1142
Comments
I think if we console log an error then it should show the full stack trace even on warning mode (like it does in error mode), would that be good enough? |
PR merged, an stacktrace will show in the console in warn mode in the next release |
I'm used error mode, but even with it stacktrace sometimes is not really informative. |
Ah, feel free to reopen the issue then if you think the new addition is not enough |
Did you check in the actual browser console? It should show an arrow near the error line that allows you to see the full stack trace once expanded (at least in chrome) |
In browser stacktrace is available, of course. But there is situations, when in stacktrace there is no any my source files - for example, if you add some arrow function callback, which is reading some field from mst, stacktrace just don't showing any meaningful strings in stacktrace, because it contains only call string of this callback, but not define's string. |
I thought sentry could be configured to use source maps and browse stack traces. |
In our sentry sourcemaps are enabled, of course. But, as I said, even stacktraces isn't helpful sometimes, so name of acessed property should simplify debug in some cases. |
Yeah, just that I needed! Big thanks for it. |
Error displays wrong action path. There is should be Error: [mobx-state-tree] You are trying to read or write to an object that is no longer part of a state tree. (Object type: 'Chat', Path upon death: '/data/chats/items/4cd66e4b-09be-4c21-8153-1fa37f69758b', Subpath: 'id', Action: '/data/chats/items/4cd66e4b-09be-4c21-8153-1fa37f69758b.setData()'). Either detach nodes first, or don't use objects after removing / replacing them in the |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions. |
Feature request
Is your feature request related to a problem? Please describe.
When actions are invoked at destoyed node, there is no action name in error description, which can be helpful for debug. Currently I should use breakpoint on error throwing inside mst code to see stacktrace and look at action name.
Describe the solution you'd like
Show action name in assertAlive error if possible, or, in general, name of accessed field.
Are you willing to (attempt) a PR?
The text was updated successfully, but these errors were encountered: