# Hi, where is the variable that is undefined?

**URL:** <https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945>\
**Category:** Help\
**Tags:** game\
**Created:** [April 4, 2023, 3:09pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945 "2023-04-04T15:09:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [April 4, 2023, 3:09pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/1 "2023-04-04T15:09:38Z")

</div>

I am getting a Program Error: cannot read properties of undefined (reading: vtable) Just wondering what variable and where the error occurs.

Here is the game:

> **[Board Games, error with variable](https://arcade.makecode.com/S21798-83822-72789-06904)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [April 5, 2023, 3:44pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/2 "2023-04-05T15:44:13Z")

</div>

Wow, I looked really hard, but I couldn’t find anything…

Maybe, just maybe (don’t take this seriously if it sounds dumb I’m just a newb) check the \*_postion_ function. I don’t know but I think it might be that.

I like chess 🙂

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [April 5, 2023, 3:44pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/3 "2023-04-05T15:44:17Z")

</div>

there is no variable, thats the issue

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 5, 2023, 3:46pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/4 "2023-04-05T15:46:49Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7c40af6bba557e6302c0f40151c53886477781c0.png)  
Debug menu is great for this! It looks like the on game update is running _before_ the sprites were created. Perhaps you could implement a few seconds delay or have the on game update block not run if the game has been running for less than 300 milliseconds or so.

---

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [April 5, 2023, 8:06pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/5 "2023-04-05T20:06:01Z")

</div>

Thanks! It worked just as you said. 😃

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 5, 2023, 11:15pm UTC](https://forum.makecode.com/t/hi-where-is-the-variable-that-is-undefined/18945/6 "2023-04-05T23:15:05Z")

</div>

Awesome!
