- Home /
Unity - WebGL build works fine into the localhost but not into the webserver
I wanted to create a WebGL game with Unity. So i created my version of the game, i built it and works just fine in the localhost that unity launches after the build, but when i upload it in my web server, the game gives me the following error:
Unable to load file Build/TimeMesser.framework.js.gz! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)
And: the debug tool:
is http://timemesser.alterv the address to the server that you run the project from? Don't know why it works from localhost, but generally a WebGL project is confined to only access the server it runs on. Can you provide a little more info on your issue?
Answer by isgaroth-pl · Mar 22 at 05:39 PM
Hey, if you have content decoding error maybe try setting HTTP response header "Content-Encoding: gzip" in your web server for all files with .gz extension.
Answer by VanToRiaXVII · Mar 22 at 03:20 PM
The most likely cause of your error is that you don't have access to the files from where you're calling them. One way to fix it would be to put all your files on the server, but you'd have to change the link so that they don't try to call a remote server to access them.