# Does anyone know how to fix this? (Program Error: Cannot read properties of undefined (reading 'fields'))

**URL:** <https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449>\
**Category:** Help\
**Created:** [November 14, 2025, 5:50pm UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449 "2025-11-14T17:50:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slimey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slimey/32/27894_2.png) [@Slimey](https://forum.makecode.com/u/Slimey)\
**Post date:** [November 14, 2025, 5:50pm UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449/1 "2025-11-14T17:50:43Z")

</div>

When i die i keep getting this error, does anyone know how to fix this?

> **[snow rider 3d remake 1.0 alpha 1.1](https://arcade.makecode.com/S95645-08224-34838-44110)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

it’s located in the script that generates the world. (the generate function)

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [November 14, 2025, 10:37pm UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449/2 "2025-11-14T22:37:48Z")

</div>

The issue is that the “game over” stops the forever block from restarting after it’s done, but it doesn’t stop it from completing the code it’s running, so you die and the Wait block is still running in the Forever block, and then the Wait block stops running and it runs the function, but now after the game is over the sprites and the tilemap don’t exist anymore, so trying to do things with them causes an error.  
The simple solution is to put the Wait block after the Generate function block, like this:

 ![Screenshot 2025-11-14 at 5.35.09 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/0/f039cae5c214ea958eec77410f19c4bae15f48ce.png)

---

<div class="post-metadata">

**Author:** ![Slimey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slimey/32/27894_2.png) [@Slimey](https://forum.makecode.com/u/Slimey)\
**Post date:** [January 8, 2026, 7:41pm UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449/3 "2026-01-08T19:41:17Z")

</div>

thanks!

---

<div class="post-metadata">

**Author:** ![Danny\_Devention](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/danny_devention/32/30134_2.png) [@Danny\_Devention](https://forum.makecode.com/u/Danny_Devention)\
**Post date:** [January 9, 2026, 4:47am UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449/4 "2026-01-09T04:47:05Z")

</div>

Hey this is a pretty cool game! Is it suppost to be like Subway surfers or something of the sort? If it was I’m pretty sure I might now how to add a running character in front of the camera. Either way looks pretty good so far 👌

---

<div class="post-metadata">

**Author:** ![Slimey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slimey/32/27894_2.png) [@Slimey](https://forum.makecode.com/u/Slimey)\
**Post date:** [January 9, 2026, 5:40pm UTC](https://forum.makecode.com/t/does-anyone-know-how-to-fix-this-program-error-cannot-read-properties-of-undefined-reading-fields/40449/5 "2026-01-09T17:40:18Z")

</div>

thanks! it is based on this game: [https://www.crazygames.com/game/snow-rider-3d](https://www.crazygames.com/game/snow-rider-3d)
