-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
[Android] ReferenceError not being captured by Sentry #4321
Comments
Hi and thank you for opening this issue!, Could you share the logs from Sentry when debug is set to true? Lastly, could you share a snippet on how you are calling this function? |
@lucas-zimerman Thanks for the prompt response!
Here is the example code snippet const functionA = (
var1: number,
var2: number,
var3: string,
) => {
callFunction1({
param1: {},
param2: () => callFunction2(),
});
};
useEffect(() => {
if (
!varA &&
((varQ === '' && !bool) || (varQ === '1' && bool))
) {
const num = 1
if (num) {
functionA(
var1,
var2,
var3,
);
}
}
}, []); In the above code snippet, Checking v5.34.0, will post the results shortly. |
Package update from v5.33.1 -> v5.34.0 did not log the Sentry event as well. |
Thank you for the details and testing it with the latest v5. |
@lucas-zimerman Have you reproduced this error? |
What React Native libraries do you use?
React Navigation, Hermes
Are you using sentry.io or on-premise?
sentry.io (SaS)
@sentry/react-native SDK Version
5.33.1
How does your development environment look like?
Sentry.init()
Steps to Reproduce
The app is getting initialized with sentry without any issue, and also the sentry crash test is working.
In a component inside the App, it does not have a function imported and is called, which is throwing a ReferenceError locally but the same issue is not populated in sentry. When i converted the function to
async
, it did the trick.The app is within the sentry error boundary and we were expecting the crash to show up, even for synchronous functions but thats not the case.
Can someone help look into this?
Expected Result
The event should be logged on sentry dashboard, sentry should capture one.
Actual Result
Sentry not able to capture ReferenceError crashes inside a React native component
The text was updated successfully, but these errors were encountered: