WebGL build fails in Brave browser (945897)

Hey all,

I’ve got a demo project uploaded to my website with a WebGL build which is still early days but loads fine on Chrome, Edge, and Firefox (plus/minus a few canvas placement bugs which still need to be fixed I’m assuming are unrelated to this particular issue), and doesn’t load at all in Brave.

In Brave the error message displays after the initial unity logo loads aprox. 90% and then says:

“Unable to load file Build/Early_Days_Build_V0.1.framework.js.gz! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)”

The brave devtools console provides the following information:

"
JQMIGRATE: Migrate is installed, version 3.4.1
index.html:1

Refused to execute script from ‘…/EarlyDaysDemo/Build/Early_Days_Build_V0.1.framework.js.gz’ because its MIME type (‘application/x-gzip’) is not executable, and strict MIME type checking is enabled.

Early_Days_Build_V0.1.loader.js:1 [UnityCache] ‘…/EarlyDaysDemo/Build/Early_Days_Build_V0.1.data.gz’ successfully revalidated and served from the indexedDB cache"

Since it’s loading fine in other browsers, the file obviously exists in the right spot but now unsure of what the next step is to debug it.

Worth noting I’ve already updated server settings and when queried about MIME type checking server admin said that wasn’t the issue and suggested I reach out here. Any suggestions would be appreciated.

Thank you in advance for any time you send my way.

b

It sounds like it’s doing the correct thing here. Clearly a gzip file cannot be “executed”.

Try to countercheck this with any other browser by enabling strict MIME type checking to see if the issue then also occurs in those browsers. If so, it may be an oversight on Unity’s behalf and you should send a bug report.

I wouldn’t expect much though given that Brave has a “less than single-digit” percent market share.

Thanks for your reply. I appreciate the context.

I actually just logged in to report I fixed it by switching to a Brotli build in the player settings, although I didn’t notice the fix until I cleared the browser cache. Not sure why switching to Brotli itself solved the problem. Greater minds then mine may know.

Reason be that in your server, js.br MIME type defined as javascript, and the js.gz was defined as gzip.

look at the bottom at additional headers

Ah! Thank you for the info. Stoked to be learning new things everyday!