Unhandled promise rejections are not logged to sentry
See original GitHub issueMy feature request is connected to the bug https://github.com/getsentry/sentry-react-native/issues/1077.
I’ve tried the solution from docs, but it didn’t work out for me. So I found another solution with polyfilling existing Promise in React Native.
I’ve used this package
import { setUnhandledPromiseRejectionTracker } from 'react-native-promise-rejection-utils';
import { getCurrentHub } from '@sentry/core';
setUnhandledPromiseRejectionTracker((id, error) => {
getCurrentHub().captureException(error, {
data: { id },
originalException: error,
});
});
Inside the react-native-promise-rejection-utils
package polyfills the existing promise. You can check it out here
So I propose changing the method, removing the check for the promise version and using the package react-native-promise-rejection-utils
or polyfill directly without relaying on this package.
I think this solution is better in many ways:
- It doesn’t require user to do or check anything. It just works
_checkPromiseVersion
can be removed
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Unhandled promise rejections will not be caught by Sentry ...
Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.
Read more >Sentry React Native unhandled promise rejections are not ...
I have configured @sentry/react-native in a newly created expo bare project, and while I'm able to log issues using Sentry.
Read more >Performance monitoring is not uploaded by sentry-expo
I faced the same issue by following expo-documentation. As they do not mention performance monitoring, one parameter is missing in the init:
Read more >Usage
While a user is logged in, you can tell Sentry to associate errors with user ... By default, Raven.js capture unhandled promise rejections...
Read more >JavaScript - Docs - Sentry Documentation
By default, Sentry for JavaScript captures unhandled promise rejections as ... In case the source map files do not contain your original source...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue. I did match the versions, but that doesn’t help.
Also, setting
debug: true
doesn’t show me the[Sentry] Unhandled promise rejections will be caught by Sentry.
message.I have the same issue with:
Please issue an urgent fix. Thanks!