Skip to content

GH Pages WebGL build not working because of gzip compression #3

@paulosalvatore

Description

@paulosalvatore

Building WebGL and deploying to GitHub Pages isn't working because gzip compression is enabled.

Tried to run your gh-pages branch from https://yanniboi.github.io/game-ci-test/ and console throws the following error.

WebGL.framework.js.gz:1 Uncaught SyntaxError: Invalid or unexpected token
WebGL.loader.js:1 Uncaught ReferenceError: unityFramework is not defined
    at HTMLScriptElement.n.onload (WebGL.loader.js:1:3028)
    ...

I think we need a server configuration in order to make gzip compression work from GH Pages by adding Content-Encoding: gzip to .gz files.

This recent docs link shows code samples to do that, but I'm not sure it is supported for GH Pages.
https://docs.unity3d.com/2021.2/Documentation/Manual/webgl-server-configuration-code-samples.html

Any ideas on how to make gzip compression work with GH Pages and Unity WebGL?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions