Open vaughn-xyz opened 1 week ago
FWIW could an alpha build be done with this change in the source?
/* @preserve */
if ('orientation' in screen && 'removeEventListener' in screen.orientation) {
screen.orientation.removeEventListener('change', state.current.orientationHandler)
} else if ('onorientationchange' in window) {
window.removeEventListener('orientationchange', state.current.orientationHandler)
}
Probably need to add /* @preserve */
to both remove and add. I am having difficulties testing if this fixes the problem as I currently cannot reproduce it, only some uses have reported this
Our version in
package.json
---8.17.6
We have reports of user's encountering the above error which seems to stem from
use-measure
(imported inCanvas
). From the source, it would appear as though there are enough logic gates to make sure this wouldn't throw but surprisingly in our build it seems some of these checks are removed.This is what gets compiled at build time:
Yet the source looks like:
Most specifically, it looks like support is dropped for
if ('orientation' in screen && 'removeEventListener' in screen.orientation)
. While I will investigate our build line to see why it is dropped, this could be a bigger support issue and maybe a different logic gate should be used to ensure it doesn't throw