Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

webgl broken on 2019.x

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

  1. goldbug

    goldbug

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

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    633
    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:
    633
    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:

unityunity