- Home /
WebGL builds in version 2020.2.1f1 are not working?
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?
Answer by Qhuhuit · Jan 17, 2021 at 09:38 PM
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 !
Thank you for the info. I'll try it when I get the chance..
For now I simply downgraded to some 2019 version...
I really don't like the path they go with Unity 2020..
It seems that they are solely focusing about changing instead of
improving.. With each new update of 2020 things gets worse and worse..
Answer by syeddaniyalrizvi · Mar 13, 2021 at 12:12 PM
What worked for me: Player Settings -> Publish Settings -> Compression Format, Select Disabled.
Answer by Charles_Games · Jan 14, 2021 at 04:40 PM
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
I've read that thread, though I have no idea what is that .htaccess..
Is that a file? If so, I don't find it.. In the build folder there is only 4 files, 3 of which are zipped.
Answer by DouLiu2021 · Aug 19, 2021 at 12:44 PM
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!
To quote the last bit of the accepted answer:
checking "Data caching" & "Decompression Fallback", and unchecking "Prebake Collision Meshes" & "Optimize Mesh Data" made my build run !
In most cases when a build doesn't load it's due to wrong server configuration. Nobody seems to read the documentation on that topic. If you serve pre-compressed content, your server has to provide the correct "Content-Encoding" header in the response.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
WebGl build throw numbers (maybe assembly pointers) 0 Answers
How to use Webgl Debug Symbols? 0 Answers
Blank screen on WebGL (Lighting) 0 Answers
Cant build on WebGL 0 Answers