-
Notifications
You must be signed in to change notification settings - Fork 33
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: new crashlytics transport is not properly reporting errors #110
Comments
The transport is intentionally very simple, accepting only strings, because Crashlytics is used in production, where the stack trace would be incomprehensible anyway due to the JS bundle. JavaScript source maps would need to be sent to Crashlytics, but I’m not sure if that’s currently possible… |
Sorry, I think I didn't organized the info in this issue the best way. The important part is kinda hidden. The problem is not the stack trace, but string only logs not being sent at all to crashlytcs. When using this transport, I immediately got warnings from the firebase lib informing that those reports were going to be ignored because they're not Error instances. I realize now that I should've investigated a little more. I started the integration with crashlytcs in my app and reported this as soon as I noticed, but collecting more data about the actual behavior would be better. In short, what I noticed:
Since these logs/reports can take some time to be processed by crashlytcs. I think the period of my observations were too short, and so, they can be wrong. |
I just ran into this as well, what I did was this, the comment points out the issue that was noticed: logger.createLogger({
transport: [ crashlyticsTransport ],
transportOptions: {
CRASHLYTICS: {
recordError(msg) {
// firebase/crashlytics expects an instance of error here
// however, react-native-logs expects msg to be type string
crashlyticsModule.recordError(new Error(msg));
}
}
}
}) Any thoughts on supporting the latest signature of |
When I use it, I get this warning:
firebase.crashlytics().recordError(*) expects an instance of Error. Non Errors will be ignored.
Checking the implementation I noticed that props.msg is being passed down to recordError, but props.msg besides being typed as any is
aways a string
As a quick workaround I wrapped errors in an Error:
but this is a bad alternative and customTransport ends up being reported as the source of the error.
Maybe a better approach would be to:
but thats is just an suggestion and maybe not the best solution
The text was updated successfully, but these errors were encountered: