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

Asset Bundle caching errors

Discussion in 'WebGL' started by PhilAllcock, May 1, 2015.

  1. PhilAllcock

    PhilAllcock

    Joined:
    Sep 3, 2013
    Posts:
    27
    I have been implementing asset bundles to reduce the overall build size. I don't see any issues when testing inside the editor but when I create a build I get the following error in both Chrome and Firefox when loading asset bundles from the cache:

    Invoking error handler due to
    Uncaught TypeError: Cannot read property 'length' of null
    MEMFS.getFileDataAsTypedArray @ WebGL.js:1
    IDBFS.loadLocalEntry @ WebGL.js:1
    (anonymous function) @ WebGL.js:1
    IDBFS.reconcile @ WebGL.js:1
    (anonymous function) @ WebGL.js:1
    IDBFS.getRemoteSet.IDBFS.getDB.index.openKeyCursor.onsuccess @ WebGL.js:1

    As far as I can see it isn't causing any noticeable issues apart from showing an alert on screen.
     
  2. EasyLow

    EasyLow

    Joined:
    Oct 13, 2013
    Posts:
    5
    I have the same issue. If you find the solution, write it here, please.
     
  3. unity839

    unity839

    Joined:
    Mar 28, 2014
    Posts:
    9
    I have the same issue. I was able to isolate it to a specific scenario. My asset bundle contains a list of prefabs, i started adding one by one and it was working fine (the "Cannot read property 'length' of null" error was not showing). As soon as I'd hit about 20 prefabs in my test reaching about 5mb id start getting the error. You will get that error Depending on the size of your external asset bundle. It's some sort of caching limit in the browser loader. For me, once it gets around 5mb I start seeing that. But I don't know yet how to fix that. Any other ideas?
     
  4. crushforth

    crushforth

    Joined:
    Jul 22, 2010
    Posts:
    113
    I have the exact same error. I started moving everything over to asset bundles in an attempt to improve the WebGL loading/compiling time (Currently around 1 minute 45 seconds) and I get the above error on the last of my 3 asset bundles.

    Did you find a solution to this issue?
     
  5. PhilAllcock

    PhilAllcock

    Joined:
    Sep 3, 2013
    Posts:
    27
    I haven't explored the issue too much further since. I changed things so only the ui would load from a bundle rather than an additional 2 bundles and the error no longer appears.
     
  6. crushforth

    crushforth

    Joined:
    Jul 22, 2010
    Posts:
    113
    Thanks, I'll keep looking into it. Maybe its because I'm generating my AssetBundles in code and not using the new Unity 5 method for making Asset Bundles via the editor.