• Building
  • HTML5 Exporting not working with Newgrounds

I've already made a post about this on Newgrounds itself, though with no luck. I'm also sorry if this is not anybody's expertise, but I have nowhere else to go, as no one else online has seemed to document this. These are the errors I receive while previewing the game:

Failed to load resource: the server responded with a status of 500 ()
Uncaught ReferenceError: Engine is not defined

I made sure to rename the html file to index.html, but I still get the same error. Apparently you are supposed to have all resources at the root of the folder, but since Godot packs it into a .pck file with no alternative, all that are in the folder are these: I have no idea if it is the .pck creating the errors or something else, because it only ends up uploading around 5 bytes of data. Any amount of help on this would be appreciated.

I don't have a perfect answer, since I'm struggling with this issue as well. But I've made a little headway in that you can probably get it to work if you upload it to itch.io or run it on a python server on your desktop.

May I add, this seems to be one of those Underpants Gnome issues that's been around a lot. Been scouring for answers and there's just not a lot out there that deals with these HTML5/Godot issues.

@Shecky2000 said: But I've made a little headway in that you can probably get it to work if you upload it to itch.io or run it on a python server on your desktop.

I made sure to run the HTML5 project through the Godot editor player, and it worked perfectly fine. I also plan on uploading the project to itch.io as well, however I wanted to test out the Newgrounds API for medals and the like. I found a custom Newgrounds API node for Godot by someone. As far as I could tell it attempted to work, but nothing of note ever went through.

When I'm baffled by something (as I am now with a different version of this issue), I just keep simplifying and removing to isolate it. You might want to try to get it to work on itch.io just for a test. If that goes okay, then start adding things bit-by-bit. If you do find the hitch, start searching here/github for the more specific issue.

I don't think you'll get much of an answer about the Newgrounds thing, since I doubt most here have used it. But, fix the basics and you might get there.

Good luck!

Your JavaScript and WASM names aren't matching the HTML's file name. Did you export with an empty name? You should always specify a proper file name for the HTML file such as index.html, so that other files can be called index.wasm, index.js, etc.

@Calinou said: Your JavaScript and WASM names aren't matching the HTML's file name. Did you export with an empty name? You should always specify a proper file name for the HTML file such as index.html, so that other files can be called index.wasm, index.js, etc. Well wouldn't you know, I exported with everything named index from the start and it miraculously worked. I tested out exported with everything as something other than index, and it uploaded, but it denied it since, well, there was no index.html. It seems it likes having everything under one name, but it just so happens that index is the only way to upload, therefore everything has to be named index. I honestly feel like an idiot for having not thought of doing that before, but I give the highest of thanks! One thing I did find weird is that the window of the embedded HTML was a tad bit smaller than the desktop resolution, despite being the same on export. I managed to equalize by adding a couple more pixels (roughly 60 * 2, 60 respectively) Other than that it works as intended! I'll make sure to come back to Godot forums for any other Godot related issues I have. Cheers!

One thing I did find weird is that the window of the embedded HTML was a tad bit smaller than the desktop resolution, despite being the same on export. I managed to equalize by adding a couple more pixels (roughly 60 * 2, 60 respectively)

Since Godot 3.3, the low-DPI fallback is also obeyed on HTML5. Try enabling Allow Hidpi in the Project Settings then export the project to HTML5 again.

5 months later

@UkiUki said: the same here

Can you explain more about your issue with some details or any error messages?

@cybereality said:

@UkiUki said: the same here

Can you explain more about your issue with some details or any error messages?

Already solved. The problem was in misnaming