lazysizes
lazysizes copied to clipboard
Bind addEventLister to window for sentry
I used sentry and lazysizes and I encountered the following error:.

The reason is that when window.addEventListener is set to alias as addEventListener, window's bind is gone.
So I bind addEventListener to window.
https://github.com/getsentry/sentry-javascript/blob/cc08ef4558c88b03d81ae3370900d175035ca443/packages/browser/src/integrations/trycatch.ts#L89
this is undefined
But this is an error of sentry. Why do you want to change the code here. Instead of sentry itself?
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.