Sentry receives many errors about crashes in non-app "reportError"

We have Sentry setup in our Checkout Extensions. We have noticed we get a lot - thousands a day - of errors that look like this:

This says:

[native code] in reportError
[native code] in forEach

As we can’t upload source maps into Sentry it’s difficult to determine how exactly this error is happening.

Has anyone seen anything similar or have any advice on where the problem might lie? Is it a Sentry issue or a Shopify issue?

I don’t know if this is a Sentry issue, so I’ve raised a Sentry issue in their repo:

I haven’t seen similar reports of an issue like this - but I’ll follow the GitHub issue you linked to see what might be uncovered there.

Hi edhgoose,

Obviously it’s impossible for us (Shopify) to say exactly what’s throwing that issue, so bringing it up with Sentry is the right call there. But I would say it’s likely to do with the way we sandbox extensions. They aren’t able to interact directly with the page, and that may be what Sentry is trying to do (accessing the DOM directly for example) and when that isn’t possible it’s throwing errors.

Just some insight, I don’t think there’s anything we can do about this at the moment.

Thanks @JohnKing - I assumed as much as well.

Don’t suppose you can enlighten me on whether there are any restrictions/changes/etc to how reportError (Window: reportError() method - Web APIs | MDN) might be affected by your sandboxing?

It looks like reportError is still accessible from within your sandbox - have I interpreted that correctly? So I can still call it without any restrictions, in the same way I can call console.log?

It looks that way, from playing locally:

The thing that’s puzzling me is I understood “native code” to mean “browser code”, and so if reportError is the function that’s throwing, wouldn’t that suggest a browser bug rather than a Sentry or Shopify issue?

(I’m wondering if this is a better link - it’s reportError inside the worker: WorkerGlobalScope: reportError() method - Web APIs | MDN)

That’s exactly it, everything will be reported and logged within the worker itself. Maybe you can catch and report a bit more of a trace with that if you want to debug yourself, it’s a good idea.

I don’t personally know any restrictions imposed by reportError since it is meant specifically for workers, but it’s not an area I’m very familiar with the more subtle nuances of.