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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make working WebGL build?

Discussion in 'WebGL' started by Manveru, Jun 14, 2015.

  1. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    Hi.

    Im testing WebGl. I've created a plane with button on it and make Webgl build. But it not working. Not on local: (some socket number), not on denwer. I've turned Enable exeptions and increase memory size to 1024. But he still trow errors in console. Often different, sometimes it do nothing, just print null and write "Player is loading" when im pressing fullscreen button. For now error is

    Invoking error handler due to
    SyntaxError: missing while after do-loop body

    Is there a some video guide or some text about how to make and build small webgl app with Unity GUI?
     
  2. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    On 1024 error is:
    Invoking error handler due to
    SyntaxError: missing while after do-loop body​

    or all seems ok, but nothing happens and on header:

    GET http://test1.ru/Development/www.data
    200 OK
    78ms
    fileloader.js (строка 68)

    ЗаголовкиОтветHTML

    показать исходный код
    Accept-Ranges bytes
    Connection Keep-Alive
    Content-Length 2116277
    Content-Type text/html; charset=UTF-8
    Date Sun, 14 Jun 2015 14:18:18 GMT
    Etag "5a00000000fbeb-204ab5-5187af87f584f"
    Keep-Alive timeout=5, max=97
    Last-Modified Sun, 14 Jun 2015 14:15:17 GMT
    Server Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c PHP/5.2.12

    показать исходный код
    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Encoding gzip, deflate
    Accept-Language ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
    Host test1.ru
    Referer http://test1.ru/
    User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0​


    ancer is null


    On 2048 is:

    Invoking error handler due to
    RangeError: invalid array length
    UnityConfig.js (строка 74)


    RangeError: invalid array length

    var buffer = new ArrayBuffer(TOTAL_MEMORY);​

    Is that because 2000Mb is too much?
     
    Last edited: Jun 14, 2015
  3. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    Anyone? For now ill try to download lates Unity (Used 5.0.1f3, ill try 5.1 )/
     
  4. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    I've never seen that error. Is it possible that your js file has not been uploaded completely, so that the browser is trying to load some partial script code?
     
  5. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    I think all ok with downloading file on server, because it is local virtual Web server called Denwer and i just copy files from one folder to another :D.
    Ive downloaded last Unity version (5.1.0f3 64 bit), also ive installed VCCredist 2012 and cmake. Buildind non Develop with memory cap size 256 and EnableExeptions Explitly Thrown. All work prety fine, no alert js messages, in console there are only one error:

    but program with simple script button and input field printing some text to console log works fine.
     
  6. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    But building it like Development build still call out of memory error. And if you build if agail like non Dev. build all work again. Is development build needs a much more memory?
     
  7. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    I've set memory size to 512, and Dev build started work without problems too. But there more errors in console:
     
  8. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    These are not errors, just informational log messages from emscripten.
     
    Manveru likes this.
  9. Manveru

    Manveru

    Joined:
    May 11, 2015
    Posts:
    8
    Oh, thanks, sorry for disturbing.