# Can't share or download png save

**URL:** <https://forum.makecode.com/t/cant-share-or-download-png-save/36838>\
**Category:** Help\
**Created:** [May 21, 2025, 8:36pm UTC](https://forum.makecode.com/t/cant-share-or-download-png-save/36838 "2025-05-21T20:36:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![T-ZevSeitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/t-zevseitz/32/22543_2.png) [@T-ZevSeitz](https://forum.makecode.com/u/T-ZevSeitz)\
**Post date:** [May 21, 2025, 8:36pm UTC](https://forum.makecode.com/t/cant-share-or-download-png-save/36838/1 "2025-05-21T20:36:43Z")

</div>

A couple of my students have ran into an issue where they cannot download their projects as pngs or create a share link. When they try to create a png MakeCode thinks for a while and then stops the process without saying anything (no error or popup). I looked into the browser counsel when this happened and “RangeError: Invalid string length” error (see images).

Does anyone have any advice on how to resolve this issue?

 ![Error2](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/4/c4b260a657db5f22b29efb1c6accb86c7171a8f4.jpeg)  
 ![Error1](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/1/c150243c38ca40b9c7abf60da4cd1da428ec4ad1.jpeg)

---

<div class="post-metadata">

**Author:** ![T-ZevSeitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/t-zevseitz/32/22543_2.png) [@T-ZevSeitz](https://forum.makecode.com/u/T-ZevSeitz)\
**Post date:** [May 21, 2025, 9:12pm UTC](https://forum.makecode.com/t/cant-share-or-download-png-save/36838/2 "2025-05-21T21:12:44Z")

</div>

As a further update one of the projects now cannot be opened from the My Projects page saying “Sorry, we could not load this project” and the Edge console has a “Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘text’)” error. I assume this project is unrecoverable, but I would like to know if there are any know causes of this to avoid in the future.

---

<div class="post-metadata">

**Author:** ![a012](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/a012/32/24099_2.png) [@a012](https://forum.makecode.com/u/a012)\
**Post date:** [August 25, 2025, 6:32pm UTC](https://forum.makecode.com/t/cant-share-or-download-png-save/36838/3 "2025-08-25T18:32:13Z")

</div>

### **Step 1: Backup Everything**

Before you touch anything, make a copy of the `.mkcd` file. Even if it’s broken, we don’t want to lose what’s left.

* * *

### **Step 2: Rename and Unzip**

1. Rename the file from `project.mkcd` → `project.zip`.
2. Unzip it with any zip tool (Windows Explorer, 7-Zip, WinRAR, etc.).

You should see a folder structure with files like:

- `main.ts` (your TypeScript/blocks code)
- `project.json` (project metadata)
- `assets/` (sprites, tilemaps, images)

* * *

### **Step 3: Inspect `project.json`**

Open `project.json` in a text editor (VS Code, Notepad++, etc.)

- Look for huge base64-encoded strings — these are usually embedded images or tiles.
- If there’s an obvious **very large string** , that’s likely what’s breaking the PNG/export.

* * *

### **Step 4: Temporarily Remove Problematic Assets**

1. Move large images or tilemaps out of the folder (just somewhere safe).
2. Save the edited `project.json` without them.
3. Zip the folder back up and rename to `.mkcd`.

This stripped-down project may now open in MakeCode and export as PNG or share link.

* * *

### **Step 5: Recover Code**

If `main.ts` is intact, you can open it and copy all your scripts into a new project.

- Even if images are gone, the code logic is usually salvageable.
- Re-import small versions of the assets gradually instead of all at once.

* * *

### **Step 6: Prevent Future Issues**

- Avoid massive inline images — load them via `img` functions instead of embedding huge base64 data.
- Break big games into smaller projects.
- Save `.mkcd` backups often.
- Consider exporting backups before major changes.
