Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    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.

webgl broken on 2019.x

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

  1. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    774
  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: