Unable to parse Build/build.framework.js.br
Asked Answered
C

3

9

We have uploaded unity application to hostinger. When we launch index.html from app - getting error:

Unable to parse Build/build.framework.js.br! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug.

Cychosz answered 31/5, 2022 at 19:15 Comment(1)
Did you follow unity’s webserver instructions or assume to allow certain compressions? This is common with the assumptions or older instructionsTypesetter
A
12

You have compression enabled for you project. Go to Project Settings -> Player -> Publishing Settings on WebGL tab - and you can change your compression format to Gzip or disable it altogether.

Allegra answered 1/9, 2022 at 14:21 Comment(1)
Got the same error with GZIP, disabling worked for me.Cult
R
3

Enable decompression fallback in publishing settings

use decompression fallback in publishing settings

Rostand answered 27/2 at 14:40 Comment(0)
S
0

To resolve that error and several others that came after it, I found that I needed to manually make my server add a Content-Encoding: gzip header to three files and a Content-Encoding: application/wasm header to one more file.

For WPEngine, here are the four Header Rules that need to be added under the environment's Web Rules:

Set > Content-Encoding > gzip > Only on successes > URI = /MYFOLDER/Build/MagnetAtomic_Build.data.gz

Set > Content-Encoding > gzip > Only on successes > URI = /MYFOLDER/Build/MagnetAtomic_Build.wasm.gz

Set > Content-Type > application/wasm > Only on successes > URI = /MYFOLDER/Build/MagnetAtomic_Build.wasm.gz

Set > Content-Encoding > gzip > Only on successes > URI = /MYFOLDER/Build/MagnetAtomic_Build.framework.js.gz

Replace MYFOLDER with the correct relative path for your website.

Some of the headers were being aggressively cached by Chrome even after I tried all of the usual cache-busting methods, so I had to completely close it before it would recognize the new headers.

Sokul answered 9/8 at 17:21 Comment(1)
@ChrisF - I've deleted my answer on the other thread and reposted it here since it's more relevant to this question.Sokul

© 2022 - 2024 — McMap. All rights reserved.