Bash.tv → GitHub → itch.io

Beta, untested. Diagnose and recover a broken browser game project fast: a triage script that checks index.html and script paths, JavaScript syntax in every file, imports of missing files or names that aren't exported, missing or wrongly capitalized assets, git state with a safe way back, and (for 2D games) page errors and blank screens in a browser; plus the order to work in, how to recover wi...

Download skill (.zip) Files on GitHub

Game emergency repair

Beta: this skill is new and has not been tested yet. It is still being improved. Check its results carefully and say what goes wrong.

Calm, then triage

Tell the person it’s very likely recoverable and that nothing will be deleted. Then:

python3 scripts/triage.py .                                    # files, syntax, imports, assets, git
python3 scripts/triage.py . --url http://localhost:8080/       # plus the browser (2D and DOM games only)

Fix the first problem in its list and run it again: one syntax error or a wrong import breaks everything after it, so later problems often disappear.

For WebGL games, use read_preview_console on the viewer’s preview or check_gpu_render instead of --url.

Get back to working

  1. Before changing anything: git stash (or copy the folder when there’s no git). Nothing is lost.
  2. Does the last commit work? If yes, the break is in the stashed changes: git stash show -p, then git stash pop and undo the bad part.
  3. If the last commit is broken too: git bisect between a commit that worked and now finds the one that broke it.
  4. Fix, test in the preview, commit with a message saying what broke.

Common causes

Symptom Usually
Blank page, nothing in the console wrong script path in index.html, or a module without type=”module”
“Unexpected token” syntax error, often a missing bracket from an edit
“does not provide an export named” renamed function, import not updated
Works locally, broken online file name capitalization, absolute paths, http assets
Black canvas, game “running” an exception in draw every frame, or a scene that never starts

After the fix, add a regression check (game-regression-testing) so it doesn’t happen again.

Pitfalls

Changing many things at once while panicking, deleting “broken” files, force-pushing over history, and calling it fixed without loading it in the preview.