• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 "Uncaught ReferenceError: GameMaker_Init is not defined" error in HTML5, game not loading! D:

My game isn't loading at all, not even a loading screen, when I launch it in HTML5. Older backups seem to start fine but I can't tell what happened between this version and the last that would cause the below error to occur.
(In case it's important, this is it running in debug mode and it's from the developer console of Firefox)



I've tried clearing the cache.

Any ideas? I'd be super appreciative.
 

Ricardo

Member
Check Options > HTML5 > Advanced > Included file as index.html.
If you are using a custom index.html file, make sure it is accessible as an included file. Otherwise select "Use Default".
 
Check Options > HTML5 > Advanced > Included file as index.html.
If you are using a custom index.html file, make sure it is accessible as an included file. Otherwise select "Use Default".
1605225577321.png
It's only got Use Default as an option. Which is a shame, this feels like the path to fixing this thing.

Is there any means of reproducing what could be the "original" index.html could be?
 

Ricardo

Member
Right... First line in the error is "Uncaught Error: undefined". This may indicate a function or something else is returning undefined in HTML5 making the runner crash. This may be a bug, or something HTML5 specific which is documented.
Try to run the project in debug mode (F6) and use Chrome dev tools to stop execution when the error happens. That should give an idea of what's causing the error.
 
Right... First line in the error is "Uncaught Error: undefined". This may indicate a function or something else is returning undefined in HTML5 making the runner crash. This may be a bug, or something HTML5 specific which is documented.
Try to run the project in debug mode (F6) and use Chrome dev tools to stop execution when the error happens. That should give an idea of what's causing the error.
I've tried futzing with the index.html, to no avail (I was able to make a copy of the file by creating an executable of loose files and then editing that.
I can confirm that it's using the new index.html files but it appears to be a problem with GameMaker: Studio 2, as changing any number of elements seems to just confirm that whatever GameMaker_Init is, it's not there and I... straight don't know how to make it find something that's not there.

I've filed a bug report, but do you think there's anything else I could do to possibly remedy this?

I really appreciate the help thus far, by the way.
 

True Valhalla

Full-Time Developer
GMC Elder
Can you check if your default index file includes the following line of code? Simply compile your project and search the output.

GML:
<script>window.onload = GameMaker_Init();</script>
 
Can you check if your default index file includes the following line of code? Simply compile your project and search the output.

GML:
<script>window.onload = GameMaker_Init();</script>
I can confirm that line is in there. I tried replacing the onload to load with a custom index.html file and it didn't help. I saw that some people have trouble with the onload function.
 
Top