# Code deleting randomly

**URL:** https://forum.makecode.com/t/code-deleting-randomly/35057
**Category:** Help
**Created:** [March 31, 2025, 5:00pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057 "2025-03-31T17:00:11Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [March 31, 2025, 5:00pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/1 "2025-03-31T17:00:11Z")

</div>

When I delete a certain block, a chunk of the on start section just disappears, too.  
I can always undo, but it is still mildy infuriating every time this happens. 😑

---

<div class="post-metadata">

### Author: ![CopySprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/copysprite/32/35475_2.png) [@CopySprite](https://forum.makecode.com/u/CopySprite)
#### Post date: [March 31, 2025, 5:21pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/2 "2025-03-31T17:21:55Z")

</div>

This happens to me too. I delete an unneeded block, test my code and find out that the code to create the player is gone. @richard (Sorry for pinging you) do you know anything about this?

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [March 31, 2025, 5:23pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/3 "2025-03-31T17:23:33Z")

</div>

i need more detail than what you’re giving me to diagnose this. any chance you can record a video of this happening? or do you have a share link to a project where this happens and steps to reproduce the issue?

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [March 31, 2025, 6:18pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/4 "2025-03-31T18:18:25Z")

</div>

@richard I have a screen recording, but I can’t upload it

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [March 31, 2025, 6:18pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/5 "2025-03-31T18:18:27Z")

</div>

I have an open On start with a lot of code in it. then, I’m toggling another thing, most probably On game update. The On start is all the way off screen. I delete something while holding Ctrl. Suddenly, the screen clips a little. When I go back, half my code on start is _poof_

---

<div class="post-metadata">

### Author: ![naily](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/naily/32/19103_2.png) [@naily](https://forum.makecode.com/u/naily)
#### Post date: [March 31, 2025, 6:21pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/6 "2025-03-31T18:21:25Z")

</div>

I have the same error! I don’t know exactly how it happened, but I did take a screenshot of what it did

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/3/23c51f7801325cd1210df1dab4e743d1f976ce69.png)

It deleted ALL of the variables (hover was created AFTER it happened)  
as well as all of the player types.

> **[CAPATCHA](https://arcade.makecode.com/S40452-85101-49560-98716)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

heres the link to the project (I did nothing to it as of writing this)

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [March 31, 2025, 7:53pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/7 "2025-03-31T19:53:25Z")

</div>

Here’s another demonstration of how this happens. Hope this helps.

 ![Screenshot 2025-03-31 12.25.16 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/f/1f382341d7a039eb0754b489a39484f20758c680.jpeg)

---

<div class="post-metadata">

### Author: ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)
#### Post date: [April 1, 2025, 5:16pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/8 "2025-04-01T17:16:39Z")

</div>

this happened to me too it also made a new variable named i and then when i reloaded everthing was normal except all of the variables i messed with got turned into variables

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 1, 2025, 8:27pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/9 "2025-04-01T20:27:25Z")

</div>

@naily next time that happens, please open up the developer tools and try to see what is in the console

to get what’s in the console

1. open the browser developer tools by either:  
a. right clicking on the page somewhere (not the blockly workspace) and choosing “inspect”  
b. pressing the F12 key  
c. pressing “ctrl + shift + i” on windows
2. switch to the console tab in the view that appears
3. send me a screenshot of everything in there

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 2, 2025, 1:16am UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/10 "2025-04-02T01:16:45Z")

</div>

i wrote up some more detailed instructions on how to copy the browser console and other things to do when reporting a bug:

> [@What to do when you encounter a bug](https://forum.makecode.com/t/what-to-do-when-you-encounter-a-bug/35120):
>
> Hey folks! We here at the MakeCode team try our best to fix any bugs that forum users run into in a timely manner. However, it can sometimes be difficult for us to diagnose or fix these bugs when we can’t recreate the bug ourselves. That’s why we need YOUR help when you encounter bugs to get the most information about the problem as possible. The purpose of this post is to lay out a few things you can do when posting about bugs to make it easier for us to figure out the root cause and fix 'em! …

---

<div class="post-metadata">

### Author: ![KensingtonianNinja](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kensingtonianninja/32/20742_2.png) [@KensingtonianNinja](https://forum.makecode.com/u/KensingtonianNinja)
#### Post date: [April 2, 2025, 5:08pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/11 "2025-04-02T17:08:45Z")

</div>

something that happened to me was I just added a new colour palette and committed on github only to find everything was gone. Got it back but it scared me.

---

<div class="post-metadata">

### Author: ![naily](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/naily/32/19103_2.png) [@naily](https://forum.makecode.com/u/naily)
#### Post date: [April 4, 2025, 6:42pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/12 "2025-04-04T18:42:41Z")

</div>

It happened again!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/0/c0b310fb4f010e2e60ab9df27321dab09c500537.png)  
Removed the formatting I had for a text sprite.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 4, 2025, 10:29pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/13 "2025-04-04T22:29:12Z")

</div>

thanks @naily! I was able to quickly figure out the problem thanks to your logs:

> <https://github.com/microsoft/pxt/pull/10492>
>
> this was an issue reported on the forum \[here\](https://forum.makecode.com/t/code…-deleting-randomly/35057/12?u=richard)
> 
> looks like i mixed up the arguments of setFieldValue. I checked out every other place we call setFieldValue and looks like this was the only one with this issue.

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [April 4, 2025, 11:18pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/14 "2025-04-04T23:18:08Z")

</div>

i’ve also had this problem

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/6/96b317f5bbc981d571118ff134899e210ac2e534.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/7/07e1509beb6647ce8760006097c0e21736a3bf65.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/a/ba0b7c015ac293a3fbdc6668d56ad4daf2ef6597.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/9/d901bc8df613c4b20b01536c911c318180a31dd8.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/4/34185299f30e7a6ad1f61fb1cc23acbd4c4fd405.jpeg)

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [April 15, 2025, 4:20am UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/15 "2025-04-15T04:20:40Z")

</div>

because of some chromebook thing, I can’t access the console log, but I can describe what keeps happening. It’s like @naily’s bug but it also affects spritekinds. The most annoying thing is that this happens like every 10 minutes. 😭 if this keeps happening, it will effectively make me destroy me computer, quit Makecode, and never finish my game jam game.

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [April 15, 2025, 4:20am UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/16 "2025-04-15T04:20:46Z")

</div>

I am not going to lie this happened again 30 seconds after me writing this post.

---

<div class="post-metadata">

### Author: ![CodePerson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeperson/32/32288_2.png) [@CodePerson](https://forum.makecode.com/u/CodePerson)
#### Post date: [August 5, 2025, 6:23pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/17 "2025-08-05T18:23:30Z")

</div>

![Screenshot 2025-08-05 at 10.50.59 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/b/0bbdb173c6af6771a95906cdc261144c830badda.png)  
this seems to happen to only some projects randomly, and it happens to most when you have custom spritekinds. It’s where every one of your variables disappear and your custom spritekinds also disappear. This used to happen constantly and seems to be happening for my coder king 5 project.

---

<div class="post-metadata">

### Author: ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)
#### Post date: [August 6, 2025, 5:20pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/18 "2025-08-06T17:20:46Z")

</div>

I keep getting the sprite kind deletion bug, as well as tile deletion bug, both being incredibly frustrating. Just for reference, the tile deletion bug just makes every set tile to () block go blank. I also had a really weird one this morning when it changed some to the blank blocks, and some to these white half blocks? As in, triangle white slopes that I didn’t have in the assets.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [October 24, 2025, 5:46pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/19 "2025-10-24T17:46:06Z")

</div>

i can now happily report that the SpriteKind and Variable disappearing bug has finally been fixed! the bug fix was released moments ago and the new version of arcade is 2.0.61 (you can check what version by clicking “About” in the gearwheel menu). it might take a second for your computer to download the update but it should be automatically refreshed when you go to the website.

---

<div class="post-metadata">

### Author: ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)
#### Post date: [October 25, 2025, 5:59pm UTC](https://forum.makecode.com/t/code-deleting-randomly/35057/20 "2025-10-25T17:59:41Z")

</div>

Yeah! No more will all my variables be replaced with a random “i” variable for some reason seriously that something straight out of an arg

Anyways wonder what specifically caused the issue.

[Next page](https://forum.makecode.com/t/code-deleting-randomly/35057.md?page=2)
