Search Unity

|Error on runing WebGL Build

Discussion in 'Editor & General Support' started by Wulirocks, May 18, 2022.

  1. Wulirocks

    Wulirocks

    Joined:
    Mar 18, 2013
    Posts:
    63
    Hi
    upload_2022-5-18_10-43-13.png
    Got this error when launching my WebGL game... any idea what that means?
    Any is there a better place to post this type support request?

    Thanks.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Does it work properly when you Build and Run locally?
     
  3. Wulirocks

    Wulirocks

    Joined:
    Mar 18, 2013
    Posts:
    63
    I can't run a WebGL build locally.. because I have an error like : you're browser does not support running from local host... something like that.
    I made some research..
    https://forum.unity.com/threads/to-use-dlopen-you-need-to-use-emscriptens-linking-support.521968/

    And the suspect number one seems to be

    1. using System.Net.WebSockets;
    2. using System.Threading;
    3. using System.Threading.Tasks;

      see "hholanda" response. The hard thing here is that if that is the , that mean I have to say good bye to Unity Adressable.. which uses Threading... and rip apart a lot of game's code when is ready for released.... I will do some testing in the meantime...
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Just compare to a new/empty WebGL project. Does that work? Then go from there.
     
  5. Wulirocks

    Wulirocks

    Joined:
    Mar 18, 2013
    Posts:
    63
    upload_2022-5-18_22-17-22.png
    Here is a brand new project .. I installed WebGL publishing package and the empty project works perfectly when uploaded to Unity server. I does not locally.. but that has no importance for now.

    I did some test regarding
    1. using System.Net.WebSockets;
    2. using System.Threading;
    3. using System.Threading.Tasks;
    I used them in my empty project... unity server Web GL has no error. But it is definitely problematic because, Task does not work properly with WebGL.
    In the unity code, I asked in an async Task to move this logo few pixel toward the right every 1000ms , and to iterate the value of text Task step from 0 to
    10... the result in the Web GL build is that the logo does not move, and the value of text does not iterate.

    Since my game do a lot of data loading in async task ... there may be may be problems coming from there.. I am now going to strip that away and replace with coroutines...



    upload_2022-5-18_23-35-50.png
     
  6. Wulirocks

    Wulirocks

    Joined:
    Mar 18, 2013
    Posts:
    63