# TypeError: Cannot read property 2 of undefined

**URL:** <https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216>\
**Category:** Bugs\
**Created:** [February 7, 2021, 2:27am UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216 "2021-02-07T02:27:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@adam](https://forum.babylonjs.com/u/adam)\
**Post date:** [February 7, 2021, 2:27am UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/1 "2021-02-07T02:27:40Z")

</div>

Reproduce this error by:

1. Go to playground with chrome
2. Open devtools
3. Click toggle device toolbar button.
4. left click the babylon scene and then click devtools

error

---

<div class="post-metadata">

**Author:** ![adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@adam](https://forum.babylonjs.com/u/adam)\
**Post date:** [February 7, 2021, 2:39am UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/2 "2021-02-07T02:39:11Z")

</div>

This is where the error occurs:

> <https://github.com/BabylonJS/Babylon.js/blob/cd31eb68e67afe5f2e879a87e67e11d130fad11a/src/DeviceInput/deviceInputSystem.ts#L468>

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 7, 2021, 2:18pm UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/3 "2021-02-07T14:18:43Z")

</div>

Pinging @PolygonalSun

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [February 8, 2021, 5:46pm UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/4 "2021-02-08T17:46:40Z")

</div>

Lemme take a look and see what’s going on

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [February 10, 2021, 5:44pm UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/5 "2021-02-10T17:44:28Z")

</div>

So just an update on this, it looks like with how this is checking each of the pointerIds, it’s also trying to work with ids that have already been resolved and removed. I have a fix incoming today that should take care of this issue.

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [February 12, 2021, 8:51pm UTC](https://forum.babylonjs.com/t/typeerror-cannot-read-property-2-of-undefined/18216/6 "2021-02-12T20:51:21Z")

</div>

This issue is fixed by this PR: [Properly register pointerUp event for touch input when window is blurred by PolygonalSun · Pull Request #9913 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/9913)
