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. Dismiss Notice

WebGL doesn't work on chrome!?

Discussion in 'WebGL' started by developer1992, May 17, 2016.

  1. developer1992

    developer1992

    Joined:
    Apr 30, 2016
    Posts:
    7
    Hi.

    I have had an error that is weird!!! I have built my project as WebGL by release and compressed!!

    I have uploaded it on local server(IIS 10) and it's working in edge and firefox but doesn't work on chrome!!!

    This is my web.config file:

    Code (CSharp):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <configuration>
    3.   <system.webServer>
    4.     <staticContent>
    5.             <mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
    6.             <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    7.             <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
    8.             <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
    9.             <mimeMap fileExtension=".jsgz" mimeType="application/x-javascript" />
    10.         </staticContent>
    11.     <urlCompression doStaticCompression="true" doDynamicCompression="false"/>
    12.     </system.webServer>
    13. </configuration>
    14.  

    This is my error in chrome!!

    Code (CSharp):
    1. Failed to load resource: the server responded with a status of 404 (Not Found)
    2. UnityLoader.js:1 Decompressed Release/WebGL.memgz in 234ms. You can remove this delay if you configure your web server to host files using gzip compression.
    3. UnityLoader.js:1 Decompressed Release/WebGL.datagz in 126ms. You can remove this delay if you configure your web server to host files using gzip compression.
    4. UnityLoader.js:1 Decompressed Release/WebGL.jsgz in 725ms. You can remove this delay if you configure your web server to host files using gzip compression.
    5. UnityLoader.js:1 optimizing out Math.fround calls
    6. UnityLoader.js:1 Invoking error handler due to
    7. Uncaught RangeError: Invalid typed array length
    8. blob:http%3A//localhost/f1663393-0e54-4c4d-8eed-f5cadfe3abc4:1 Uncaught RangeError: Invalid typed array length
    I really don't know what's going on!??
     
  2. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello developer1992.

    If you want your build to run on 32-bit Chrome, use less than 1GB memory for heap. Normally it should work well with about 768MB i.e. set TOTAL_MEMORY: 805306368 or less in your index.html
    (by the way, doStaticCompression does not apply here, as content is already compressed, also, .jsgz is a compressed file and should normally have application/octet-stream mime type)
     
  3. developer1992

    developer1992

    Joined:
    Apr 30, 2016
    Posts:
    7
    Hi alexsuvorov,

    I really appreciated! I was working on something else, I just saw your answer. My problem was about heap size! I've solved it by your help!

    Thanks a lot