Skip to content

(WebGL) dynCall are deprecated and not working in Unity6 with Wasm23 enabled #55

@miv

Description

@miv

After transfering game to Unity6 i've discovered that it crashes in WebGL builds with cryptic errors:

10:32:41.453 WebGL_Build.framework.js.br:9 Uncaught ReferenceError: dynCall is not defined
    at connection.socket.onopen (WebGL_Build.framework.js.br:9:150900)
connection.socket.onopen @ WebGL_Build.framework.js.br:9

After some investigation i've found that dynCalls are deprecated and not working when wasm 2023 enabled it seems.

For now i've added jspre file with shim to work around this issue but JsWebSocket.jslib need to be updated to use {{{ makeDynCall('vii', 'callback') }}}(1, 2) as per Unity docs.

My shim based on https://github.com/RageAgainstThePixel/com.utilities.websockets/blob/main/Utilities.Websockets/Packages/com.utilities.websockets/Runtime/Plugins/WebSocket.jspre with global dynCall's added is attached for anyone to use while fix is pending - rename to WebSocket.jspre and put into Plugins/WebGL

WebSocket.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions