Skip to main content

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

Having trouble getting the HTML5 version of GMLIVE up and running

A topic by ArgosOz created 14 days ago Views: 143 Replies: 15
Viewing posts 1 to 6
(3 edits)

- Gamemaker Runtime: `2024.13.1.242`

- macOS

- GMLiveForGM2022+.yymps

---

### Steps Taken

| 1 | Created a brand‑new project. |

| 2 | Placed an **obj_gmlive** instance in *room 1*. |

| 3 | Noticed the **neko gmlive-server.n** process running under `BLANK GAME2/datafiles/GMLive`. |

| 4 | Built and ran the game as **HTML5**. The page loads, shows a single client connected, then I stopped it. |

| 5 | Added the following code to the project: ```if (live_call()) return live_result;``` |

| 6 | Re‑built and ran again as **HTML5**. |

### Observed Result

- **neko gmlive-server.n** process no longer shows a new client connection.

- The HTML5 build opens a blank page.

- The following recurring error message appears in the browser console.

Uncaught TypeError: Cannot read properties of undefined (reading '_7v2')

    at method_get_self (BLANK%20GAME2.js?cachebust=497454674:9426:419)

    at gml_Script_anon_40_184346_40_live_api_func_40_GMLive (BLANK%20GAME2.js?cachebust=497454674:1090:138)

    at gml_Script_live_api_func_add (BLANK%20GAME2.js?cachebust=497454674:1096:321)

    at gml_Script_live_preinit_init_funcs (BLANK%20GAME2.js?cachebust=497454674:4388:428)

    at gml_Script_live_preinit_api (BLANK%20GAME2.js?cachebust=497454674:4477:343)

    at gml_GlobalScript_GMLive (BLANK%20GAME2.js?cachebust=497454674:322:107)

    at gmlInitGlobal (BLANK%20GAME2.js?cachebust=497454674:4500:216)

    at _bI2 (BLANK%20GAME2.js?cachebust=497454674:8279:65)

    at _cw3 (BLANK%20GAME2.js?cachebust=497454674:9647:280)

BLANK%20GAME2.js?cachebust=497454674:5374 Unhandled Exception - Uncaught TypeError: Cannot read properties of undefined (reading '_7v2') in file http://127.0.0.1:51264/html5game/BLANK%20GAME2.js?cachebust=497454674 at line 9426

And I’m unable to launch the HTML5 build again unless I remove the extension.

Developer (2 edits)

Hard to tell, the extension passes unit tests on my end, and I don’t think I have changed anything HTML5-related since the last public release.

If this is in Safari, you could try another browser. If that doesn’t do it either, run in debug mode and enable “pause on exceptions” + “pause on caught exceptions” on Sources/Debugger tab of browser’s Developer Tools so that you can see what function is causing trouble.

(1 edit)

> If this is in Safari

I tested both Firefox and Brave, but the exact same error persisted.

To eliminate any accidental configuration issues, I also created several new blank projects from scratch; the problem remained unchanged.

This is the stack:



Is this what you wanted to see?

Developer (1 edit)

If you tick “pause on caught extensions”, the debugger will pause when this error happens and you will be able to click through the previous items on the Call Stack to see which function it was going over when this happens.

However, I have just re-downloaded the latest YYMPS from Itch, imported it into a new project, and that works fine:

Entering main loop... test23.js:85325:47
[GMLive][28/09/2025 22:26:36] GMLive.gml v1.0.76 for GM2022+
[GMLive][28/09/2025 22:26:36] Initializing...
[GMLive][28/09/2025 22:26:36] Indexing assets...
[GMLive][28/09/2025 22:26:36] Indexed OK!
Audio Engine => Loading
[GMLive][28/09/2025 22:26:36] Trying to connect to gmlive-server...
Application Surface created: w=640, h=360
Audio Engine => Suspended
[GMLive][28/09/2025 22:26:36] Ready!

Are you sure that you are on the current version of GMLive? Based on your gmlive-server build date, it seems that you are on 2024.2 minifix from March last year, and I have to fix something related to HTML5 support after every other GM update.

> Are you sure that you are on the current version of GMLive?

To troubleshoot the issue, I was running multiple builds with different version numbers to determine whether any changes would resolve it.




Is this the latest?
Developer

That is the latest server; the extension version is printed to Output/browser console (see above), or you can check the build date in the beginning of “Extensions ➜ GMLive ➜ GMLive” script. With sufficiently poor luck you may have to remove the Extensions ➜ GMLive folder before re-importing a new YYMPS.

For debugging, you’ll want to press Continue a few times until you get to this error in particular, though if you are completely unfamiliar with using a debugger, you might instead email me your test project after you make sure that the extension is the newest version.

> if you are completely unfamiliar with using a debugger...

I'm not unfamiliar (though I'm not an expert either) but I don't know what we are looking for. 

I'm going to email you a project newly created with everything latest.

(1 edit)

I think it would help a lot if you could share a complete, ready‑to‑run starter project that shows off all the GMLIVE features. Right now I’ve followed your instructions to set up GMLIVE in a fresh test project, and everything compiles fine. However, when you say:

“Change the “live” scripts/events as you see fit.”

I’m not sure what changes are expected. For example, how do I live‑edit a sprite?

Simply put: the fresh project builds and runs the HTML5 test without any build‑time errors, but once it’s running in the browser I start seeing some console errors I can’t quite figure out. For example:

 

I suspect this is because I’m not sure what steps to take next.

Here is the test project. (Gmail refuses to email it)

Could you tweak it so that it showcases just the basic functionality of GMLIVE?

<project received>

Developer

Can you also post a screenshot of your HTML5 preferences? I’m doing this here (is that the default?) and I’m not seeing your error, but I’m seeing some other things:

audio_group_name crashes for lack of an audio group

Where did it go

You can find this bit

	for(var l_i=0;l_i<256;l_i++){
		var l_agn=audio_group_name(l_i);
		if(l_agn==undefined||l_agn==""||l_agn=="<undefined>")break;
		live_api_asset_add(l_agn,l_i);
	}

And replace it with

	for(var l_i=0;l_i<256;l_i++) try{
		var l_agn=audio_group_name(l_i);
		if(l_agn==undefined||l_agn==""||l_agn=="<undefined>")break;
		live_api_asset_add(l_agn,l_i);
	}catch(_){}

Sprite reloading

After fixing the sprite_set_live call to use the right sprite, it turns out that you can’t buffer_save ➜ sprite_add anymore..? But that’s okay, 2024.11 supports Data URIs, so you could find this

				var l_tb=buffer_base64_decode(ds_list_find_value(l_frames,l_i1));
				if(l_tb==-1){
					live_log_script("Error: couldn't decode base64 for "+l_name+".",2);
					continue;
				}
				buffer_save(l_tb,l_tmp);
				buffer_delete(l_tb);

and replace it with

				if (os_browser == browser_not_a_browser) {
					var l_tb=buffer_base64_decode(ds_list_find_value(l_frames,l_i1));
					if(l_tb==-1){
						live_log_script("Error: couldn't decode base64 for "+l_name+".",2);
						continue;
					}
					buffer_save(l_tb,l_tmp);
					buffer_delete(l_tb);
				} else l_tmp = "data:image/png;base64," + ds_list_find_value(l_frames,l_i1);

… but that will not save you, for sprite_assign is non-functional on latest runtime - the sprite becomes transparent and its sizes are reported as -1.

Perhaps you could workaround this by rewriting that whole block of code to use sprite_replace ➜ sprite_add_from_surface, but I wouldn’t be too hopeful about stability of those functions either.

> Can you also post a screenshot of your HTML5 preferences?

Developer

I’m not getting any other errors in your test project with these settings either, but are you getting the original method_get_self error after making these changes? I’m noticing that your screenshot above doesn’t have it

If you are only getting it in your main project with latest GMLive, you could find this bit

	static h_set_func = function(l_func) {
		var l_rawFunc;
		if (is_method(l_func)) {
			l_rawFunc = method_get_index(l_func);
			var l__self = method_get_self(l_func);

and replace it with

	static h_set_func = function(l_func) {
		var l_rawFunc;
		if (is_method(l_func)) {
			l_rawFunc = method_get_index(l_func);
			var l__self;
			try {
				l__self = method_get_self(l_func);
			} catch (e) {
				l__self = undefined;
				show_debug_message("Error getting method self for " + self.h_signature + ": " + string(e));
			}

> If you tick “pause on caught extensions”, the debugger will pause when this error happens



I did that.

> Are you sure that you are on the current version of GMLive?

This is the version I've downloaded first and I'm running the latest GameMaker.

When I build for macOS, the extension runs as expected and it behaves correctly.