designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

DOM event objects provided as errors are hard to troubleshoot

Open dtinth opened this issue 4 years ago • 1 comments

Some code (not sure if ours or 3rd party) seems to be throwing an Event object.

image

This is a commonly-misused pattern in JavaScript world.

something.onerror = e => {
  throw e
}

It would help if the event name and event target class name is serialized in Datadog RUM.

dtinth avatar Oct 15 '20 09:10 dtinth

Hi @dtinth, browsers intentionally hide errors thrown by script files from different origins for security reasons.

You could try tweaking your CORS settings (if you control the third-party origin), or set crossorigin=anonymous on the script tags. For more details check out this blog post.

Let me know if that works for you 😄

elsmr avatar Nov 28 '20 12:11 elsmr