React component render error inside ErrorBoundary captured twice


#1

I’m building out a proof of concept to integrate Sentry / raven-js with an existing React web app. I have an ErrorBoundary component which captures render errors and captures them with Raven. I’m seeing the error get duplicated though since it appears Raven has already wrapped something and so I get duplicate errors. I’ve created a simple reproduction here:

Anyone know what’s up?

Thanks in advance!


#2

Btw, for the repl.it you will need to wait for the page to load and then dismiss the repl.it dialog indicating there is an error. Underneath that you will see my ErrorBoundary component render the errors caught by RavenTestKit.

You can explore the source by clicking the file icon.


#3

Also, fwiw, it looks like the second (unexpected and duplicate) error being captured is coming from addEventListender? Here is the mechanism info:

{
“mechanism”: {
“type”: “instrument”,
“data”: {
“target”: “EventTarget”,
“function”: “addEventListener”,
“handler”: “callCallback”
}
}
}


#4

Ok, I think this is actually a bug. Filed as https://github.com/getsentry/raven-js/issues/1432