yanniboi / game-ci-test

9 stars 11 forks source link

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

Open paulosalvatore opened 2 years ago

paulosalvatore commented 2 years ago

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.

BNJMO commented 1 year ago

I am trying to revive this question as I face the same problem. Anyone?

discorporated commented 1 year ago

+1 this issue in 2023

WarpedNet commented 10 months ago

image_2023-10-26_224957291 For anyone still having this problem, Go to File -> Build Settings -> Player Settings (in the bottom left) -> Under Player (Left side) -> WebGL Settings (Html 5 Logo) -> Publishing Settings and enable Decompression Fallback and then rebuild and send to github