Closed wbobeirne closed 2 years ago
Hey thanks for writing in. We should guard against patching prototype's multiple times here: https://github.com/getsentry/sentry-javascript/blob/8c77bb6a0b1602ffc7ad802938897cc63a26c67a/packages/browser/src/helpers.ts#L53
Could you provide some kind of reproduction so we can investigate further?
I'll see what I can rustle up, unfortunately this is only happening on an internal site so I don't have immediate access to the bundle that's causing this but I'll see if I can reproduce independently.
The entire property might be possible to remove. This PR removes it and should also fix this: https://github.com/getsentry/sentry-javascript/pull/4286
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)@sentry/react
Version:
Description
I have Sentry embedded in a javascript snippet that customers put on their own sites. It's worked fine everywhere except for one instance where they're getting this error on an
XMLHttpRequest
my script makes:Looks like that's from this wrapper:
https://github.com/getsentry/sentry-javascript/blob/8c77bb6a0b1602ffc7ad802938897cc63a26c67a/packages/browser/src/helpers.ts#L130-L146
Which wraps XMLHttpRequest here:
https://github.com/getsentry/sentry-javascript/blob/dcd549b4b50de32c3d532c65d7d6049061742f63/packages/browser/src/integrations/trycatch.ts#L97-L99
It seems like I could provide an option to disable wrapping of
XMLHttpRequest
, but I'd hate to do that for non-problematic installations. Could this property assignment instead by try / catch'd to avoid disruption?Unfortunately I don't have the customer's code to determine what module they might be using that's causing
XMLHttpRequest
to already have this property as read-only, though I can only assume it's them also having Sentry installed. If that's the problem, is there a safe way to have two Sentry installations on one site?