current-device icon indicating copy to clipboard operation
current-device copied to clipboard

Uncaught TypeError: changeOrientationList[index] is not a function

Open hymair opened this issue 5 years ago • 3 comments

This error is logged on resize.

image image

hymair avatar Jan 06 '20 08:01 hymair

Thanks for reporting @hymair.

I can't replicate it on my end. Can you share User Agent / more details where you discovered this?

matthewhudson avatar Jan 08 '20 05:01 matthewhudson

Happens on latest Chrome. Here's some debugging:

image image

So looks like it's trying to execute landscape('landscape') as a function, but there's no such function. Let me know if you need any more specific info.

hymair avatar Jan 09 '20 08:01 hymair

Would it be possible to validate if it is a function before?

typeof changeOrientationList[index] === 'function' && changeOrientationList[index](newOrientation);

robertogrip avatar Jan 14 '20 19:01 robertogrip