lazysizes icon indicating copy to clipboard operation
lazysizes copied to clipboard

Bind addEventLister to window for sentry

Open osamu38 opened this issue 6 years ago • 3 comments

I used sentry and lazysizes and I encountered the following error:. スクリーンショット 2019-05-14 18 44 07

The reason is that when window.addEventListener is set to alias as addEventListener, window's bind is gone.

So I bind addEventListener to window.

osamu38 avatar May 14 '19 09:05 osamu38

https://github.com/getsentry/sentry-javascript/blob/cc08ef4558c88b03d81ae3370900d175035ca443/packages/browser/src/integrations/trycatch.ts#L89

this is undefined

osamu38 avatar May 14 '19 10:05 osamu38

But this is an error of sentry. Why do you want to change the code here. Instead of sentry itself?

aFarkas avatar May 14 '19 12:05 aFarkas

Hi @aFarkas, this issue is actually not an issue with Sentry but with the lib as window is lost especially when doing SSR in some frameworks like Angular. This fix binds the window object which should solve this.

cozzbie avatar Nov 08 '19 11:11 cozzbie