[Error] TypeError: undefined is not an object (evaluating 'e._inputs[Mi.Touch][c][Oi.LeftClick]=0')

Babylon: 6.7.0

Mobile Safari 15.6.6
Mobile Safari 15.7.0
Desktop Safari 16.6.0
Mobile Chrome 115.0.5790
Tablet Chrome 98.0.4758

The line in the code: https://github.com/BabylonJS/Babylon.js/blob/8a42ad80d4419c668120f5eedac9be6a2b8f5a3a/packages/dev/core/src/DeviceInput/webDeviceInputSystem.ts#L598

TypeError: undefined is not an object (evaluating ‘e._inputs[Mi.Touch][c][Oi.LeftClick]=0’)

at ? js/babylon-6_7_0.js

And similar:

TypeError: undefined is not an object (evaluating ‘e._inputs[Mi.Touch][c]’)

at ? js/babylon-6_7_0.js

Sorry but I can’t provide more details.

can you reproduce that on the playground?

For this to be occurring, the canvas must be receiving some event for a touch that the DeviceInputSystem isn’t tracking. I’d be curious to see what value is being provided for c in that function call. I suspect that it’s going to be a -1 (no tracked point). In any case, I recently pushed a fix that should prevent that error from happening. It should be live in the next release (not sure when that is, maybe in the next week?). What I’d recommend doing would be to try the next release and see if it still occurs.


Thanks! I’ve updated BJS to 6.18.0 Lets see how it works

Seems like the issue was fixed in 6.18.0+ @PolygonalSun thank you!