Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question "both async and sync fetching of the wasm failed"-Error on a (Photon) multiplayer client build

Discussion in 'Web' started by Dufffit, Nov 6, 2020.

  1. Dufffit

    Dufffit

    Joined:
    Apr 20, 2020
    Posts:
    4
    Hello everyone!

    I have a problem with a simple game. It is my first multiplayer project and also one of the first Unity projects in general. For the multiplayer I am using Photon PUN2.

    In my project I have a host build, where the host can create a room. This one has a usual Windows build. Additionally there is a client build, from which the room(s) can be entered and which should be build in WebGL and later be placed on a website, so that the client users can reach and use it from this website.

    Now I made a first test and have a problem with the WebGL client build. On my computer, it works totally fine. It works in unity, it works when I open the index.html file in my browser and it works when I put it onto my home server. When I put it onto my home server, I can also run it from other computers in the Network without any problems.
    But if I take the folder of the WebGL build and try to start the game via the index.html on another machine I get the following error and I do not unterstand why:

    abort("both async and sync fetching of the wasm failed") at jsStackTrace@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:738:12
    stackTrace@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:752:11
    abort@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:18:44
    getBinary@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1124:9
    getBinaryPromise/<@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1137:12

    I found similar forum threads etc. with similar errors and tested several build settings, but nothing worked. I do not understand, why everything is fine on the machine, where I created the project, but not on any other machine.
    Let my know if you have an idea, what the problem could be or if you need aditional information.
     
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Take a look at the Network tab on what the download of the .wasm file looks like? If fetching the wasm file fails, it suggests the file was not properly downloaded from the server.
     
  3. Dufffit

    Dufffit

    Joined:
    Apr 20, 2020
    Posts:
    4
    Thank you for your answer! Which Network tab do you mean? The console of the browser?
     
  4. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
  5. Dufffit

    Dufffit

    Joined:
    Apr 20, 2020
    Posts:
    4
    The Network tab does not say anything about a .wasm file. It only gives an Error concerning the webgl_build.data file.
    I attached a screenshot of what the Network tab says when I try to start the client from the index.html file.

    I also recognized, that I did not give you the whole original error message. It is actually longer than the one in the original posting. Here is the full message:

    abort("both async and sync fetching of the wasm failed") at jsStackTrace@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:738:12
    stackTrace@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:752:11
    abort@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:18:44
    getBinary@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1124:9
    getBinaryPromise/<@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1137:12
    promise callback*getBinaryPromise@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1136:8
    instantiateArrayBuffer@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1184:4
    doNativeWasm/<@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1197:27
    promise callback*doNativeWasm@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1194:46
    integrateWasmJS/Module.asm@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:1264:13
    unityFramework@file:///C:/Users/[...]/Build/webglbuild_client.framework.js:20551:18
    loadBuild/<@file:///C:/Users/[...]/Build/webglbuild_client.loader.js:383:21
    promise callback*loadBuild@file:///C:/Users/[...]/Build/webglbuild_client.loader.js:382:25
    createUnityInstance/<@file:///C:/Users/[...]/Build/webglbuild_client.loader.js:426:7
    createUnityInstance@file:///C:/Users/[...]/Build/webglbuild_client.loader.js:411:10
    script.onload@file:///C:/Users/[...]/index.html:56:28
    EventHandlerNonNull*@file:///C:/Users/[...]/index.html:55:7
     

    Attached Files:

  6. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    That suggests that the .data file was not properly uploaded to the server?
     
  7. Dufffit

    Dufffit

    Joined:
    Apr 20, 2020
    Posts:
    4
    Ah, maybe there is a misunderstanding. I tried to reach the program via server, when I run my PC as a (local) server. This works totally fine.
    The problem occurs when I put the WebGL-Build (the full folder) on another machine (tested on 3 different laptops so far) and try to run it directly on this machine via opening the index.html file in the browser. This does not work.
    The .data file is also in this folder.
     
  8. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Try checking the exact HTTP error code by clicking on the failed request in the Network tab. Does it give an error HTTP 404 or something else? Then look at the web server error logs to troubleshoot why it is not serving the file in the configuration when the file is served on another machine.