NUI inline "onchange" event crash

Description:
Using the NUI system, posting a jQuery JSON data on an inline “onchange” event of any input element causes the game to crash a few moments later. There is no need of any additional JS script, besides any JQuery version (including the one stock with the internal game NUI) nor does it require for the callback to be set-up on the game scripting environment. If the callback is set-up, the arguments sometimes still get passed but will still crash a few milliseconds after. Here is an example of script that can cause the issue (by moving the slider ingame):
https://pastebin.com/AGyScedn
Server artifact version:
1856 FiveM Windows Master, but is reproducible with all versions
Expected behavior:
The scripting environment (in this case it was tested on Lua) should pick up the message without crashing afterwards.
Current behavior:
Sometimes the message gets sent, but the client crashes a few milliseconds later with no minidump, no error message nor log entry (neither on CitizenFX logs nor CEF logs)

Note that the event handler does not need to be actually set up on the scripting environment, meaning this is reproducible by just using the HTML code provided in the pastebin without having to do any data manipulation on the CitizenFX client itself. There is appended a “script.js” file but that doesn’t really matter, it was just some leftover code I forgot to remove.
Error screenshot:
N/A
.dmp/crash files:
N/A
Extra information:
SetNuiFocus needs to be set to true in order to mess with the NUI.

Game Cache version: 1.0.1207.80
RedM client: 1139860 (1.1.0.0 ?)

Possible bug instead of client support?

Yes, my bad but couldn’t find the most fitting section for this.

edit: just seen now the “Bug” section

I’ll move it for ya

1 Like

I have updated the post to reflect the correct “Bug Reports” format, hopefully it should be more clear now.
My bad if I didn’t see the section on the first hand.

1 Like

What does your NUICallback update contain? mind sharing that? I had a similar issue but i was using a Citizen.Wait inside the NUICallback function and that had to be inside a thread or else the game would just crash.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.