As the title suggests, I’ve previously built a game for WebGL in a 2019 version and it was alright.
I’ve updated to the latest version of 2020 and it simply seems that the build operation for WebGL in this version is screwed up…
First I get an error on the web page that says: WebGL builds are not supported on mobile devices.
But it’s on a browser on my computer… It’s not from my smart phone…
Secondly I get this warning: The script from “http://mygame.me/Build/MyGame%20Build.framework.js.gz” was loaded even though its MIME type (“application/x-gzip”) is not a valid JavaScript MIME type.
At last, I get 2 console errors:
Uncaught SyntaxError: illegal character U+001F
Uncaught ReferenceError: unityFramework is not defined.
What can I do to solve this?
Is this a known issue?
Is there a workaround for this?
Am I really restricted to build WebGL games only from 2019 versions?
What worked for me:
Player Settings → Publish Settings → Compression Format, Select Disabled.
I also cannot run my game build with 2020.2.1f1
I have this warning:
WebGL.framework.js:2 WebGL: INVALID_ENUM: getInternalformatParameter: invalid internalformat
_glGetInternalformativ @ WebGL.framework.js:2
Followed by
Exception at:
Error
at jsStackTrace (http://localhost:52008/Build/WebGL.framework.js:2:16493)
at stackTrace (http://localhost:52008/Build/WebGL.framework.js:2:16664)
at http://localhost:52008/Build/WebGL.framework.js:2:3544
at http://localhost:52008/Build/WebGL.wasm:wasm-function[102515]:0x1f56d07
... a tone of unreadable stacktrace
And two errors:
exception thrown: undefined - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. WebGL.loader.js:1:4256
Uncaught undefined - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. WebGL.framework.js.gz:2:563707
Only way I found after a day trying, was enabling all debug options, full stacktrace and everything. Ok it showed some warnings I’ve fixed, but still not playable in release, and unplayable in this debug condition…
EDIT: checking “Data caching” & “Decompression Fallback”, and unchecking “Prebake Collision Meshes” & “Optimize Mesh Data” made my build run !
I have the same problem, its only in FF though
I found this (https://forum.unity.com/threads/illegal-character-error-in-firefox.404224/)
but was enable to make the .htaccess work
Hello, I also meet the same error when try to run the project on web page using flask. May I know how did you solve this? By downgrading the unity or some other solution? Thanks!
I’m running Unity 2022.3.12f1 and ran into compression error issues trying to publish to GitHub pages. I was able to choose ‘Runtime Speed’ for Code Optimization under Build Settings. Then in Project/Player Settings I disabled Compression Format. More files and larger files, but it was able to run under GitHub pages.