Unable to parse Build/HTML5.framework.js.gz! - Need Help

Hi,

Just built WebGL demo and uploaded to a website, but get below error:

Completely new to Unity Engine, any help would be appreciated, thanks!

Jesse

If you uploaded a gzip (or brotli) compressed build file, you must configure your server for gzip (or brotli).

If you set up the server as described on this page, you should be able to load the content.

That worked, many thanks!

Hello there, I got the same error and am a little confused as to where the code that gtk2k referenced should go. I see that it is supposed to be configure the WebGL server, but I don’t know what to do with it or where to add it. I am new to using Unity, would appreciate any support!

NOT RESOLVED : Not working with a 2020.3.21f1 gzip build on IIS placing the web.config as described in the docs, same error

IIS URL rewrite also says the XML isnt well formed, the code in the docs is trash

getitng this too, i tried making the files suggested in the link and placing them in the path suggested, nothing happened is there more to it than this?

after hat red error became yellow and said
HTTP Response Header “Content-Type” configured incorrectly on the server for file Build/html5.wasm.gz , should be “application/wasm”. Startup time performance will suffer.

I still dont see any loading bar downloading my game though.

As I could not get my web server to work with the .htaccess given above, I decompressed the files. (here _WebGLBuild is related to my build)

gzip -d _WebGLBuild.framework.js.gz
gzip -d _WebGLBuild.wasm.gz
gzip -d _WebGLBuild.data.gz```

and edited the index.html file, removing the ".gz".

var buildUrl = “Build”;
var loaderUrl = buildUrl + “/_WebGLBuild.loader.js”;
var config = {
dataUrl: buildUrl + “/_WebGLBuild.data”,
frameworkUrl: buildUrl + “/_WebGLBuild.framework.js”,
codeUrl: buildUrl + “/_WebGLBuild.wasm”,
streamingAssetsUrl: “StreamingAssets”,
companyName: “DefaultCompany”,
productName: “Hero Born”,
productVersion: “0.1”,
showBanner: unityShowBanner,
};


it takes way more space, but it worked.

Experiencing the same error. Added “Content-Encoding:gzip” for each .gz fiels in my AWS S3 static website but it shows the same error in my Oculus Firefox. My Mac browser works fine tho

So no config notes for Nginx? Just the 2 worst performing & hardest to configure web servers instead?

Seems like others have solved this , why not put this vital data into the docs?

Also wanna note, in my case, the gz file is loaded into my browser cache without error, yet still displays the same error (OP) in the browser.

just to add a comment, you also need to activate the fallback option in the build player settings:

Try Player setting → WebGL → Publish settings → Compression = disabled.

This worked for me when hosting on GitHub pages, thank you @Steedalion !

Hello, I have a bit different problem

8375436--1104105--2022-08-19 16.54.13.jpg

As the error message says, open DevTools (in Chrome), open the Network tab, and try reloading the page. And check what kind of error you get when you access scoresquasher.framework.js.

Anybody figure out how to configure Vercel to properly serve gzip or brotli?
They talk about compression here How Compression Works for the Edge Network but I can’t see how to configure it as per Unity - Manual: Server configuration code samples

For now I’ve disabled compression, which is ok for testing but not a good idea for production.

Any vercel experts out there?

Have a reliable deployment system that covers all these options for webgl would help a lot of people atm, I think.

Looks like you’re right without compression seems perfectly fine but I can’t ignore the fact that it takes much more dn also while setting the server in vscode using Live Server I can’t seem to modify the be or gz files or reception of such, maby my lack of knowledge…

I used vercel.json to config the headers and it works well.

{
  "headers": [
    {
      "source": "/Build/:name.data.br",
      "headers": [
        {
          "key": "Content-Encoding",
          "value": "br"
        },
        {
          "key": "Content-Type",
          "value": "application/octet-stream"
        }
      ]
    },
    {
      "source": "/Build/:name.wasm.br",
      "headers": [
        {
          "key": "Content-Encoding",
          "value": "br"
        },
        {
          "key": "Content-Type",
          "value": "application/wasm"
        }
      ]
    },
    {
      "source": "/Build/:name.js",
      "headers": [
        {
          "key": "Content-Encoding",
          "value": "js"
        },
        {
          "key": "Content-Type",
          "value": "application/javascript"
        }
      ]
    },
    {
      "source": "/Build/:name.js.br",
      "headers": [
        {
          "key": "Content-Encoding",
          "value": "br"
        },
        {
          "key": "Content-Type",
          "value": "application/javascript"
        }
      ]
    }
  ]
}

Thanks!

For everyone else, this json works with Brotli compression. To use it with gzip make sure to update source extensions and header values:
file extensions: .br → .gz
header values: br → gzip