Unable build clean WebGL project

I’ve got a project to build something in WebGL within a short timespan. I created a test project, but before that I wanted to build a clean scene and see if it works at all.

However I tried building a WebGL project with 3 different 5.x versions: 5.0.1, 5.1.1f1, 5.1.2f1 and all of them give me errors and a failed build. I’ve tried to Google it up but can’t find any solution for it. I even found an issue that should be solved when installing emscripting. Strange thing is that about half a year ago when I did the same thing, it worked.

It’s a big let down as I can not rely on this part of unity software. I’ve got about few hours to send a quick prototype but with this I’m bound with my hand standing on an edge of an almost erupting volcano. :slight_smile:

Console errors:

Failed running "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten_Win/python/2.7.5.3_64bit/python.exe" "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten/emcc" @"Z:/Customer/9999 - project/04 Interactief/Unity/WebGL test/Assets/../Temp/emcc_arguments.resp"

stdout:
stderr:
WARNING  root: emcc: link command line is very long, even with response file -- use paths with no spaces
Traceback (most recent call last):
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten/emcc", line 1216, in <module>
    extra_files_to_link += system_libs.calculate([f for _, f in sorted(temp_files)] + extra_files_to_link, in_temp, stdout, stderr, forced=forced_stdlibs)
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten\tools\system_libs.py", line 749, in calculate
    libfile = shared.Cache.get(name, create)
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten\tools\cache.py", line 36, in get
    temp = creator()
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten\tools\system_libs.py", line 586, in create_libcextra
    return build_libc('libcextra.bc', libcextra_files, ['-O2'])
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten\tools\system_libs.py", line 69, in build_libc
    shared.Building.link(o_s, in_temp(lib_filename))
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten\tools\shared.py", line 1390, in link
    output = Popen(link_cmd, stdout=PIPE).communicate()[0]
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "D:\Software\Unity 5.1.1f1\Editor\Data\PlaybackEngines\webglsupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\lib\subprocess.py", line 948, in _execute_child
    startupinfo)
WindowsError: [Error 87] The parameter is incorrect

UnityEditor.HostView:OnGUI()

Never mind, seamed to be an issue with length of path as described in the error log.

did you build on 64bit Unity and on 64bit Windows -?

Yes I did. Now I removed the project to another location on the disk, it will build. However now I get memory and array length exceptions. But the scene only contains 1 cube and nothing else is inside the project.

EDIT

I changed memory build size to 512 and exceptions to non, that made it run out of memory. So I changed to 256 and with exceptions and it will run. No clue why this all happens.

could you please be more specific ?

At first with default project I did a simple build with only a cube inside the project. The first problem I encountered was the file path on HD was too long.

After I fixed that, I build again without any changes and when I ran it inside the web browser I got the warning that it ran out of memory. But I thought how could this happen with only 1 cube? So I changed the memory to 512, build and rand out again, changed to 1024 and same issue. Then I went back to 256 and it ran without the warning, but I got another warning about: array length error. So what I did was between changing the memory size I also changed to run the build with exceptions on: ‘none’. So changing that back to: ‘all exceptions’, the array length error was gone.

About the ‘out of memory’ error, that’s strange since I started with 256 first time, but later on when I changed it back it was all fine. The scene was just plain simple without any fancy code doing something with arrays or whatsoever. I think it had to do with the exceptions set to ‘none’. I did not reproduce the problem because I had no time for that.

However I do have another question. Is there a way to turn of the 2 warnings on IE? I get a warning about webGL not being supported, but it works quite ok. And the other is about ‘WebGL audio not supported’, which I would like to remove since I use no audio at all, or is there a way to strip that out? If not, maybe it would be nice not having that warning when no audio is used.