Uncaught RangeError: Invalid typed array length

I am receiving the error “Uncaught RangeError: Invalid typed array length” on chrome version 47.0.2526.106. However my build works on Firefox both locally and on my site. Where would I start debugging this? Thanks.

Unity version: 5.3.1f1 Pro

This is likely the browser failing to allocate space for your data. Check the size of your uncompressed .data file and try to reduce the size of Unity Heap / code / data.

I don’t know. In the screenshot you can see the Release directories of two builds. The links are too the same two builds. The ‘…No-Lightmap’ test is a quarter of the size of the other, but it generates the error in Chrome.

http://www.virtualziggurat.com/Projects/GreaterHills/Greater-Hills-No-Lightmaps/index.html

http://www.virtualziggurat.com/Projects/GreaterHills/10830-Greater-Hills-WebGL/index.html

your Unity Heap size is very large: 1024 ==> 1GB!

512MB in this case. Still quite big, does your content actually need that amount of memory ?

I don’t know. I’m trying to reproduce what I was doing with the WebPlayer in WebGL. I’m still just experimenting with quality and haven’t optimized my scenes yet. The first time I tested a build with more than one scene, I received the error about memory and if I was the developer to increase it. I believe it was set to 256 by default, so I bumped it up to 512. The next time I received the error I went up to 1024. I don’t have any reference point. Is there a guide of any kind comparing build size, memory requirements and load times? This project will need to load quickly initially to attract people who are just casually browsing. So I will need to end up streaming bundles in the background like I did in the WebPlayer. On the other hand, if someone is interested and is willing to wait a few minuets for it to load, I wanted to be sure I could provide very high quality content. Thank you!

I suggest you run your content on a 64bit browser, then profile memory to find out how much you actually need, lower WebGL Memory Size. Then, I would suggest to start optimizing so that you can reduce the memory requirements.

If you mean a WebPlayer vs WebGL comparison, we don’t have that. They are very different platforms, but some of the challenges are the same, like how to minimize loading times. On Unity WebGL, similarly to the WebPlayer, it is recommended to use asset bundles.

Though, to give you an idea about loading time on Unity WebGL, there is a comparison of several browsers here.