Search Unity

Offset is outside the bounds of the DataView at DataView.getUint32 (<anonymous>) at IncomeTemp.loade

Discussion in 'Web' started by tatianaivanova, Jan 28, 2022.

  1. tatianaivanova

    tatianaivanova

    Joined:
    Jul 16, 2021
    Posts:
    6
    I am building webGL with unity 2021.1.17
    current version built works well on pc. but if I check it on android, it don't works well
    I can find error just this. I hope anyone give me correct solution...

    IncomeTemp.loader.js:1 Uncaught (in promise) RangeError: Offset is outside the bounds of the DataView at DataView.getUint32 (<anonymous>) at IncomeTemp.loader.js:1
    (anonymous) @ IncomeTemp.loader.js:1
    Promise.then (async)
    (anonymous) @ IncomeTemp.loader.js:1
    callRuntimeCallbacks @ IncomeTemp.framework.js:2
    preRun @ IncomeTemp.framework.js:2
    run @ IncomeTemp.framework.js:2
    runCaller @ IncomeTemp.framework.js:2
    removeRunDependency @ IncomeTemp.framework.js:2
    receiveInstance @ IncomeTemp.framework.js:2
    receiveInstantiatedSource @ IncomeTemp.framework.js:2
    Promise.then (async)
    doNativeWasm @ IncomeTemp.framework.js:2
    (anonymous) @ IncomeTemp.framework.js:2
    unityFramework @ IncomeTemp.framework.js:2
    (anonymous) @ IncomeTemp.loader.js:1
    Promise.then (async)
    u @ IncomeTemp.loader.js:1
    (anonymous) @ IncomeTemp.loader.js:1
    createUnityInstance @ IncomeTemp.loader.js:1
    script.onload @ (index):107
    load (async)
    (anonymous) @ (index):106
     
    GGsparta likes this.
  2. umutcanfns_unity

    umutcanfns_unity

    Joined:
    May 22, 2023
    Posts:
    1
    It's been a while since you opened the topic, I hope you solved the problem. For other developers getting this error: you may need the config file. The config file solved my problem.

    Example:
    <configuration>
    <system.webServer>
    <staticContent>
    <remove fileExtension=".json" />
    <!-- Unity 5.6 -->
    <mimeMap fileExtension=".json" mimeType="application/json" />
    <mimeMap fileExtension=".unityweb" mimeType="application/binary" />

    <!-- Unity 5.x -->
    <mimeMap fileExtension=".data" mimeType="application/binary" />
    <mimeMap fileExtension=".mem" mimeType="application/binary" />

    <!-- Unity 5.3 -->
    <mimeMap fileExtension=".datagz" mimeType="application/binary" />
    <mimeMap fileExtension=".jsgz" mimeType="application/binary" />
    <mimeMap fileExtension=".memgz" mimeType="application/binary" />
    </staticContent>
    </system.webServer>
    </configuration>
     
  3. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    My guess here would be that the downloaded .data file would be corrupted, or incorrectly not uncompressed by the browser - primary reason would be if Content-Encoding: gzip or br header was not present (when compression was enabled) on the .datagz or .databr files.

    Btw starting from Unity 2023.1 onwards, UnityLoader no longer uses the JavaScript DataView API, but the simpler and more performant Typed Array View API to parse the .data file.

    If the .data file was not correctly decompressed, there should be a red banner on the screen stating that.

    If there is no red banner and web browser console does not state anything about the file being corrupt and/or not decompressed properly, but there is just a bare exception thrown, then that suggests a bug of some sorts. We do want the startup loading errors that are presented by the loader to be clear with actionable suggestions if possible.
     
  4. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    Hello :)

    I got this error using:
    - 2020.3.11
    - 2021.3.19
    - 2022.3.11

    with the 'blank' template and no compression.
    No red or orange banner.

    The server we are aiming is a LMS, so we might not be able to change server settings
    (though I believe the issue is connected to the server settings or the page address somehow)

    I haven't tried using 2023 as it's not a LTS yet, but I guess this is worth a try.
     
  5. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    Seems like the client is trying to parse something empty (I see a lot of "(0)")
    Capture2.PNG

    Oh this might explain things:
    Capture3.PNG

    Yeah, so server issues. We need the server to be able to read the data..
    I'll try changing its extension to see if things are better..
     
    Last edited: Nov 16, 2023
  6. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    Changing the .data to .data.txt (file + inside index.html) worked :)
     
    jzangseo and luke1998 like this.