JujuAdams / SNAP

Data format converters for GameMaker LTS 2022
MIT License
89 stars 15 forks source link

WSOD snap_to_json() with HTML5 #15

Closed bacteriaman closed 3 years ago

bacteriaman commented 3 years ago

There's currently a fatal bug in the HTML5 version of json_stringify() for GMS2 2.3, It outputs as expected with Windows, but returns malformed JSON with HTML5. I have filed a bug report with Yoyo, but in the meantime I need to continue development.

I was happy to discover this library as an alternative, However, I have been likewise unsuccessful in getting snap_to_json() to work with HTML5. Again, it outputs as expected in Windows, but produces a WSOD with HTML5. The

The browser console displays a very cryptic and unhelpful error message:

Unhandled Exception - TypeError: _o3(...) is undefined in file undefined at line undefined

Here's the code contained in the Create event of the Controller object:

body = {
    _links : {
        type : {
            href: "http://192.168.1.6/rest/type/score/points"
        },
    },
    title : {
        value : 100
    },
    field_game_reference : [{
        target_id : 3
    }],
    field_player_reference : [{
        target_id : 3
    }],
    field_player_ip : [{
        value : "192.168.0.16"
    }],
    field_score_points : [{
        value : 100
    }],
}

output = snap_to_json(body,true);

I attempted to attach a sample project, but unfortunately github doesn't support the yyz extension.

JujuAdams commented 3 years ago

Hiya, I ran into this recently as well. It seems to be an upstream bug in GM that I am unable to fix or even find a workaround for. Sorry, this one ain't gonna get fixed in a reasonable timeframe.

P.S. Running in debug mode de-obfuscates line numbers and stacktraces.