- Home /
Error in Unityloader.js
Whenever I open my WebGL game on my web server I get an error "Offset is outside bounds of dataview", it points to line 1 in the Unityloader.js,I have started to get an error whenever I open my game on my web server, it says "Offset is outside the bounds of dataview", an it points to line 1 line the Unityloader.js
This unity forum thread seems relevant to your problem (check the last reply there).
From what I understand, this error is caused by JavaScript code that's messing with Unityloader.js. This code can be from a library you use (the thread mentions XHook) or software you're running on your web server that injects JavaScript code (like Dynatrace mentioned there).
The OP solved the problem by disabling the library (not really helpful if you need it).
You should probably first detect which library/software's causing the error by disabling them one by one.
Answer by yotwerde · Jan 05, 2019 at 06:39 PM
JavaScript libraries are included with the script tag, where the src parameter contains the URL of the .js file of the library.
Check the HTML file from which you're running your game for script tags, comment the tags that are including libraries out, one by one, and try starting your game to see if it works. When it runs properly, you'll know that the disabled library was causing the error.
Commenting the library imports out could cause errors if functions of the library are used in your file, so you'll have to comment these out, too.
Don't forget that it could also be that not a library but a program/software that's running on your server is causing the error, so you should look into this, too.
If you're not hosting a complete website with a complex theme on your server, but just using it to test your game online, you could create a Github Pages site to host it. This worked perfectly fine for me.
@yotwerde Thanks for the tip about GitHub pages it really worked for me.