Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Help! Uploading Error: index out of bounds

A topic by PuffyChickenlegs created Mar 01, 2025 Views: 253 Replies: 3
Viewing posts 1 to 4
(+1)

   I've recently made a game in the Godot engine then attempted to upload it here as web playable, but each time (right before completely loading) I would repeatedly got the same "index out of bounds" error. I'm not sure why I'm getting this and I've re-zipped the index.html file `9 times and each time the same error. I'm so confused because I uploaded a test project to see if what I'm doing is actually correct, and that one worked completely fine.

    I'm asking here because I haven't found any other examples of someone having my same problem. Are there any solutions to this and/or am I doing something wrong? 

(1 edit) (+1)

Hi, I've got the same problem. I don't keep a comprehensive log of changes, so I can't tell what caused the game to stop working. Hopefully this gets resolved soon.


Here is the error in the console:

RuntimeError: index out of bounds    _main https://html-classic.itch.zone/html/13004545/Retro_Ball_v0.12.0(WEB).js:9
    callMain https://html-classic.itch.zone/html/13004545/Retro_Ball_v0.12.0(WEB).js:9
    Engine https://html-classic.itch.zone/html/13004545/Retro_Ball_v0.12.0(WEB).js:801
    Engine https://html-classic.itch.zone/html/13004545/Retro_Ball_v0.12.0(WEB).js:796
index.html:139:11    displayFailureNotice https://html-classic.itch.zone/html/13004545/index.html:139

Here is one code snipped that I'm led to from the console error (other lines are extremely long and I don't understand them, because they are javascript/website related):

return new Promise(function (resolve, reject) {
    for (const file of preloader.preloadedFiles) {
        me.rtenv['copyToFS'](file.path, file.buffer);
        }
    preloader.preloadedFiles.length = 0; // Clear memory
    me.rtenv['callMain'](me.config.args);
    initPromise = null;
    me.installServiceWorker();
    resolve();
(2 edits) (+2)

I've run into this same problem with Godot 4.4.1 and Firefox. First of all, I see the same error when using these test instructions from Godot's docs, so the problem isn't only with itch.

Second of all, I find that if I edit my game page to turn SharedArrayBuffer support on, the game launches now. In my limited testing, if I export the Godot project with thread support on, it worked on itch once and afterwards starting giving Array Index Out of Bounds again. It seems to work consistently when exported with thread support off.

SharedArrayBuffer support on itch is considered an experimental feature, and it's still being changed (for example, currently the game launches in a new window, and there is no way for the developer to set the window size or remove the fullscreen button). But at least the game loads.

P.S. The option for single-threaded web export was added in Godot 4.3. It's supposed to work without SharedArrayBuffer support on, but in this case, that seems to not be working. The problem isn't widely reported though, so idk what the deal is.

P.P.S. the linked Godot instructions say to run python serve.py --root , but I found I had to run python serve.py -r ./

(+1)

I will add to this since I've done some more digging lately.

The problem seems to be related to the way Godot handles arguments with which the project runs.

assert(
      args.length <= nargs,
      `native function \`${ name }\` called with ${ args.length } args but expects ${ nargs }`
      );
return f(...args)
Just to be clear, I still understand very little of this. I am a newbie.

It is also indeed true that this issue occurs only on Firefox, however it did still run on a computer I have at work - also on Firefox.
Another thing is that the project seems to run just fine on a private tab, but only once: after refresh, "index out of bounds" error appears again. This may mean there is an issue with cache or cookies.

That's all I can add for now.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.