For that error to occur, there must something wrong with the pointerout event being fired, specifically, the clientX and clientY values aren’t numbers (or aren’t defined). Usually, these are included by default when the browser fires off a pointerout event. I wonder if there’s either some custom pointerout event that’s firing or if something is affecting those values/preventing them from propagating properly in a browser fired event.
I got the error from a second device now:
Mozilla/5.0 (Linux; Android 11; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.101 Mobile Safari/537.36
seems like it happens in Android. I’ll leave it up to you if you want to catch the error.
// Check that the element at the point of the pointer out isn't the canvas and if it isn't, notify observers
// Note: This is a workaround for a bug with Safari
if (document.elementFromPoint(ev.clientX, ev.clientY) !== canvas) {
this.onCanvasPointerOutObservable.notifyObservers(ev);
}
could be NaN of infinity for reasons… on those devices. @RaananW should we simply add a check ? but I am afraid it could be for a different Root Cause.
browser event’s clientX and clientY can’t be NaN. if they are it is the browser’s issue, but i doubt this is the case. it depends on the scenario, but on certain cases we are recreating the event with (what should be) the same values. So it might be during the conversion? What would be the best way to reproduce this? Checking for NaN will be a patch and not a solution.
I’m pretty sure it doesn’t happen on the couple of Android devices I own myself.
I checked some of the logging again, and it seems to be a bit after this code succesfully runs:
Hey @mise, what is the latest version of BJS that you’ve seen these errors on? I know that there was recently a change to _onCanvasPointerOut and I was curious if you were running code that was using that change.
no, I’m still seeing it, but I also am still on version 5rc3. I’m trying to get a grip on performance, and constant updates from Babylon and the various browsers and OS’s doesn’t make that easier.
Also the last time I tried to update (to rc7 I think) I could not get my project to build anymore and that was not something I wanted to deal with either :).
I’m not in a hurry to solve this issue because I don’t think it’s causing any trouble for my players.