Search Unity

Problem with WebSocket in WebGL export

Discussion in 'Web' started by ElegantUniverse, Jul 27, 2022.

  1. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    Hello
    when I want to export the game with WebGL I encounter this error

    Code (CSharp):
    1. An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
    2. abort(62) at jsStackTrace@http://localhost:13819/Build/WebGLtest.framework.js:2:16334
    3. stackTrace@http://localhost:13819/Build/WebGLtest.framework.js:2:16505
    4. abort@http://localhost:13819/Build/WebGLtest.framework.js:2:748
    5. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[66153]:0x123d097
    6. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[21233]:0x92e571
    7. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26076]:0xa3af75
    8. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[21233]:0x92e571
    9. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26079]:0xa3b1ab
    10. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[27345]:0xa807c6
    11. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[21758]:0x955e4c
    12. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[66076]:0x123cba0
    13. unityFramework/Module.dynCall_viiii@http://localhost:13819/Build/WebGLtest.framework.js:2:494858
    14. invoke_viiii@http://localhost:13819/Build/WebGLtest.framework.js:2:374774
    15. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26081]:0xa3b5eb
    16. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26084]:0xa3b9d6
    17. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[66074]:0x123cb73
    18. unityFramework/Module.dynCall_viii@http://localhost:13819/Build/WebGLtest.framework.js:2:493754
    19. invoke_viii@http://localhost:13819/Build/WebGLtest.framework.js:2:372782
    20. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26162]:0xa41098
    21. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[26214]:0xa453a2
    22. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[64920]:0x1212f55
    23. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[31678]:0xb2dcd7
    24. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[66042]:0x123c6dd
    25. unityFramework/Module.dynCall_iiiii@http://localhost:13819/Build/WebGLtest.framework.js:2:477685
    26. invoke_iiiii@http://localhost:13819/Build/WebGLtest.framework.js:2:342430
    27. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[28785]:0xacd414
    28. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[28047]:0xaaaf24
    29. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[4180]:0x1ad1fb
    30. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[4178]:0x1acecb
    31. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[8213]:0x3143d2
    32. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[8211]:0x3132f0
    33. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10249]:0x3d56e8
    34. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[8448]:0x32e376
    35. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10670]:0x403c53
    36. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10350]:0x3defeb
    37. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10350]:0x3df000
    38. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10345]:0x3deb86
    39. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[10338]:0x3dd058
    40. @http://localhost:13819/Build/WebGLtest.wasm:wasm-function[66063]:0x123ca6a
    41. unityFramework/Module.dynCall_v@http://localhost:13819/Build/WebGLtest.framework.js:2:488789
    42. browserIterationFunc@http://localhost:13819/Build/WebGLtest.framework.js:2:176694
    43. runIter@http://localhost:13819/Build/WebGLtest.framework.js:2:179767
    44. Browser_mainLoop_runner@http://localhost:13819/Build/WebGLtest.framework.js:2:178229
    it's my code

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         socket = new WebSocket("ws://localhost:8080");
    4.         socket.Connect();
    5.  
    6.     }

    anyone here knows why this happen?