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

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 () 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

1 Like

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:

<system.webServer>

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.

Hello :slight_smile:

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.

Seems like the client is trying to parse something empty (I see a lot of “(0)”)

Oh this might explain things:

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…

Changing the .data to .data.txt (file + inside index.html) worked :slight_smile:

2 Likes