Upgrading WebGL from 2019 to 2022 Module.asmLibraryArg missing

Hi,

We’re currently upgrading our project from Unity 2019 to Unity 2022.1.15.
We have a lot of communication between the browser and the Unity player.
In the Unity project we have a javascript.jslib with all the function connected in Unity.
In the HTML project we normally call our Unity function like this:

unityInstance.Module.asmLibraryArg._functionToCall(JSON);

it seems the asmLibraryArg can’t be found.
We’ve tried several other solutions, and we can find the function when we look into the source in the browser.

thank you in advance!

Would you happen to be using an external jslib like the one described here?

It seems that others ran into this and had to remove it since it wasn’t compatible with newer Unity versions.

Hi, I’m stuck on this too.
I want to call a .jslib function from JavaScript on my browser page, but on Unity 2022.1.24 and 2022.2.9, Module.asmLibraryArg is undefined and I can’t find an alternative field in the Module object.
Is this now completely omitted?

Apologies, I misunderstood the original question (this applies to @developerarreterra as well )

If you’d like to call Unity scripts from JavaScript and JavaScript from Unity scripts, then please refer to the docs right here, you won’t be using Module.asmLibraryArg, since compiling to asm.js is no longer supported. If you’re using any plugins that use .amLibraryArg, you’ll also run into problems there.

Emscripten’s docs also describe the Module object in more detail and how to interact with it:

https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html
https://emscripten.org/docs/api_reference/module.html#module

Please let me know if you have any further questions.