littlektframework / littlekt

A multiplatform WebGPU 2D game framework written in Kotlin. Build your own game engine on top.
https://littlekt.com
Apache License 2.0
314 stars 12 forks source link

NoSuchElementException when testing touch-input chrome's device-mode #214

Closed jclohmann closed 8 months ago

jclohmann commented 1 year ago

Hi, I'm getting this exception, when trying to test touch-events in chrome's device-mode (in the devtools):

NoSuchElementException: List is empty.
    at last (webpack-internal:///./kotlin/kotlin-kotlin-stdlib-js-ir.js:1784:13)
    at touchMove (webpack-internal:///./kotlin/littlekt-core.js:47478:51)
    at HTMLCanvasElement.l (webpack-internal:///./kotlin/littlekt-core.js:47747:7)

I think the origin is this last call: https://github.com/littlektframework/littlekt/blob/master/core/src/jsMain/kotlin/com/lehaine/littlekt/input/JsInput.kt#L104

In the chrome-debugger, I can see, that $this.touchedPointers_1.array_1 is empty.

I got this error in a basic very basic setup, even without any inputProcessors.

Edit: When remote-debugging chrome on my android-device, I got the same error. (JVM on my desktop is working.)

LeHaine commented 1 year ago

Interesting. I'll check it out!