SOLVED Black screen on HTML5 export

So I ran my game for the first time in a while exporting as HTML5 and... black screen.
It loads, and then just goes black. I assume it's not running because no sounds play either.
The game runs fine in normal compile.

I've added so much since I last had a working html5 build. Are there specific things that cause this or is this a lot of commenting out lines of code and seeing what causes the issue?

EDIT:
Actually, running in debug mode gives this error, that gives me a place to start

audio_play_sound failed. WebAudio Context suspended - user must interact with the page before audio can be played.
Unhandled Exception - Uncaught { message : "unable to convert undefined to a number", longMessage : "unable to convert undefined to a number", stacktrace : [ "function _ne("unable to convert undefined to a number")
","function yyGetReal([undefined])
","function yyfplus([undefined], 60)
","function gml_Object_obj_FPS_Step_0([instance], [instance])
","function(769, 0, [instance], [instance])
","function(769, 0, [instance], [instance])
","function(769, 0)
","function _Je3()
","function _fe3()
","function _Rd3(986.447)
" ], script : "", line : -1 } in file undefined at line undefined
###game_end###-1

EDIT: It was fps_real. Manual states it doesn't work on html5 but I didn't expect it to do that. Was more expecting it to just return 0 or something.

EDIT: To anyone else reading this, remember to enable popups if you want the debugger window to show (also it has to be a debug compile not a regular compile). In chrome it's in the right of the search bar when you open HTML5, it says "pop up blocked". You need to click it and allow it through.
 
Last edited:

tkokotaj

Member
Might I ask how you figured that out? I'm getting almost the same error, but I never use fps_real, for me it seems to be my array_create() statement.

Code:
Entering main loop...
Unhandled Exception - Uncaught { message : "unable to convert undefined to a number", longMessage : "unable to convert undefined to a number", stacktrace : [ "function _ne("unable to convert undefined to a number")
","function yyGetInt32([undefined])
","function array_create()
","function gml_RoomCC_rm_menu_3_Create([instance], [instance])
","function _Lg2(0, [unknown])
","function _ee3()
","function _Rd3(494.056)
" ], script : "", line : -1 } in file undefined at line undefined
###game_end###-1
 
Last edited:
The cause for me was that fps_real returns "undefined" on HTML5, and I was trying to make an average of the fps every second. This resulted in trying to perform maths on undefined which then throws this error.
What's the code in GML? It seems your error comes from a create event within the room rm_menu_3. I'm not sure if that's a create event for the room itself or if it's a create event of an object in the room
 
Top