Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

WebGL build crashes on UnityLoader.js processing.

Discussion in 'WebGL' started by andrewskuratov, Jul 17, 2019.

  1. andrewskuratov

    andrewskuratov

    Joined:
    Dec 12, 2016
    Posts:
    7
    Hey, guys!
    Have an issue with WebGL build. Unity version: 2019.1.10f1.

    TypeError's stack trace is in attached file.
    Btw, I'm using:
    Code (CSharp):
    1. PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm;
    As I understand it's a default settings statement.

    Did anybody face similar problems with WebGL builds?
    Or can anybody assume the root of the problem?
     

    Attached Files:

  2. andrewskuratov

    andrewskuratov

    Joined:
    Dec 12, 2016
    Posts:
    7
    Problem solved!
    Issue was the amount of memory allocated for UnityLoader.js.
    In the Build folder you can find *.data.unityweb file that contains resources of your project. For my project its size is about 50 megabytes. But the default value of Emscripten arg named TOTAL_MEMORY is less than 50MB.
    Peace of code below will help to increase this value:
    Code (CSharp):
    1. PlayerSettings.WebGL.emscriptenArgs = "-s TOTAL_MEMORY=64MB";
    You can put another compatible for you value instead of 64MB.