Project doesn't load

Okay so I was making a small game and things were going well up until yesterday. I tried to add some new blocks of code but the simulator didn’t update. Later on, after I closed and opened the website, all of my assets just stopped existing for some reason and the game couldn’t run obviously. Now, a day later, I check to see if it was just a momentary thing but it just got worse, nothing is here, no blocks no assets like i started anew. Does anyone know what happened and/or how to solve it?
I have html of the simulator before this happened if that’s important

If your using Javascript @kwx solved this problem Edit: See UnsignedArduino’s response, simply drag&drop the UF2 file into arcade.makecode.com , same as loading a saved image. I’m keeping the unnecessarily complicated method below for curiosity’s sake.

The UF2 file does indeed contain a copy of the source :slight_smile:

There’s likely a cleaner way to do that, but here’s how I got the data out using command line tools.

First confirm that the “source” magic number is present - this part isn’t part of recovering, but I wanted to check if it has source at all:

$ fgrep -ba 

Use the uf2conv tool to get a binary file: https://github.com/microsoft/uf2/blob/master/utils/uf2conv.md

$./uf2conv.py ~/FILE.uf2 --convert --output FILE.bin

Load the file into a binary-clean editor, search for “LZMA”, delete everything up to and including the final } of the JSON header, and save to FILE_SOURCE.lzma . In my case, the first bytes of the compressed data was ]^@^@ or 5d 00 00 80 00 in hex.

Then use the lzma and jq tools to get the source back:

$ lzma -d < FILE_SOURCE.lzma > source.json
$ jq '.["main.ts"]' < source.json > recovered-main.ts

(The source actually contains an extra JSON header, but the extraction worked anyway.)

It should be possible to wrap this in a recovery tool, but I wanted to save the steps in case this helps someone else, or future me if I get bitten by such a bug again…\x41\x14\x0E\x2F\xB8\x2F\xA2\xBB’ FILE.uf2
495620:[binary stuff]{“compression”:“LZMA”}


Use the uf2conv tool to get a binary file: [https://github.com/microsoft/uf2/blob/master/utils/uf2conv.md ](https://github.com/microsoft/uf2/blob/master/utils/uf2conv.md)

DISCOURSE_PLACEHOLDER_2


Load the file into a binary-clean editor, search for “LZMA”, delete everything up to and including the final `DISCOURSE_PLACEHOLDER_3` of the JSON header, and save to *FILE_SOURCE.lzma* . In my case, the first bytes of the compressed data was `DISCOURSE_PLACEHOLDER_4` or `DISCOURSE_PLACEHOLDER_5` in hex.

Then use the `DISCOURSE_PLACEHOLDER_6` and `DISCOURSE_PLACEHOLDER_7` tools to get the source back:

DISCOURSE_PLACEHOLDER_8


(The source actually contains an extra JSON header, but the extraction worked anyway.)

It should be possible to wrap this in a recovery tool, but I wanted to save the steps in case this helps someone else, or future me if I get bitten by such a bug again…