Search Unity

webgl broken on 2019.x

Discussion in 'Web' started by goldbug, Sep 30, 2019.

  1. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    A proper fix is being worked on. Meanwhile, there is a potential workaround that one can add an Editor script to the build that executes

    PlayerSettings.WebGL.emscriptenArgs = "-s ERROR_ON_UNDEFINED_SYMBOLS=0";

    before running the build.
     
  3. ValfarEinWindir

    ValfarEinWindir

    Joined:
    Jun 13, 2019
    Posts:
    1
    Where do you add this "PlayerSettings.WebGL.emscriptenArgs" line?
     
  4. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    It should be added to an Editor script (https://learn.unity.com/tutorial/editor-scripting). Try the attached file for example. Place the file in directory UnityProject/Assets/Editor/buildWebGL.cs, then edit the script to configure the "levelsToPack" variable. Then use one of the newly appeared HTML5 Export menu items to build.

    Note the line 69 in that script that adds the -s ERROR_ON_UNDEFINED_SYMBOLS=0 directive.
     

    Attached Files: