-
Notifications
You must be signed in to change notification settings - Fork 139
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
React error boundary errors are not actually sent #631
Comments
Turns out that adding
on this line https://github.com/airbrake/airbrake-js/blob/master/packages/browser/src/notifier.ts#L50 looks like it supposed to be deprecated |
ah. it appears that when react is in dev mode, it throws the error again (to go to In production mode, react doesn't throw again so the boundary should be the only one that reports it. |
Hi, @frehner. Were you able to get this issue sorted out? I'm unclear on whether or not there is a problem here. |
I thought that had solved it, but from what I’ve been seeing it still appears that the window.onerror handler is catching the error most of the time, instead of the error boundary. Which means I’m missing out on the additional information the error boundary adds but the window handler doesn’t |
Can you please elaborate on this? I'm confused by the "most of the time" part. Under what circumstances does the error boundary catch the error instead of the |
Looking through the airbrake error log for a project, it appears that none of the errors that I looked through were caught by the ErrorBoundary and instead all were caught by the window.onerror listener. I'll try clean some stuff up with the ErrorBoundary, and possibly also add a |
Sounds good. Yep, your |
Things are looking good after cleaning some stuff up. I'll close this for now; thanks for your help. |
@frehner can you elaborate on how did you fix this? |
I had the same issue and this seems to have fixed it |
Following the docs here https://github.com/airbrake/airbrake-js/tree/master/packages/browser/examples/react
I tried adding params to the notify call but they never showed up in Airbrake. I then discovered that they aren't sent in the network API call either. Further digging revealed the following:
window.onerror
is being called before the React error boundary is being calledmakeDebounceFilter
that prevents the React error boundary error from actually being sentSo, it appears that you either need to turn off
window.onerror
for React apps or find another way to report the errors caught by error boundaries?The text was updated successfully, but these errors were encountered: