Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question [SOLVED] WebGL Build Error - "Unable to parse Build/[File Name].framework.js.br"

Discussion in 'WebGL' started by DwightDavis, May 1, 2021.

  1. DwightDavis

    DwightDavis

    Joined:
    Oct 19, 2019
    Posts:
    4
    THIS POST HAS BEEN SOLVED - FEEL FREE TO DELETE THIS THREAD

    Since last October I've been having issues with building WebGL files across several different versions of Unity. At first, I was running into an error where I could only build a functional WebGL build if I created a Development Build. Now even that workaround won't function. I haven't built a usable WebGL build in months, despite hours of online troubleshooting and retrying. I was hoping somebody here might be willing to help me out.

    My current version is Unity 2021.1.4f1.

    My newest build gave me an error message, shown below (my file is named "WebGL v1"):


    I also took a look in Chrome's developer tools console to investigate the error, shown below:


    Here are all of my build settings for WebGL:





    As for the project, it's a very simple platformer without any special plugins or packages in use. If you have any more questions about my build settings, my setup, or anything else, please let me know!

    Thanks for taking the time to help
     
    Last edited: May 1, 2021
  2. DwightDavis

    DwightDavis

    Joined:
    Oct 19, 2019
    Posts:
    4
    I solved the issue by changing the Compression Format to "Disabled"
     
  3. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    832
    The root issue here is like the error message is suggesting: the web server that is being used is misconfigured, and does not advertise the

    Content-Encoding: br

    HTTP response header when serving the files with a .br suffix.

    Fixing this requires configuring the web server to be able to do network compression. As a workaround if you do not have access to server configuration, you can keep the compression but enable "Compression Fallback", in which case Unity embeds a Brotli decompressor into the build. This has performance implications but can serve as a functional workaround.
     
    douglasjbostock and sergei201613 like this.
  4. mystefier

    mystefier

    Joined:
    Jul 17, 2016
    Posts:
    1
    I'm having the same problem. Can you let me know where to find the option to change the Compression Format?
     
    NubModel and heartingNinja like this.
  5. RayanAziz11

    RayanAziz11

    Joined:
    Aug 4, 2021
    Posts:
    5
    that is in player settings
     
  6. FoxbxHero

    FoxbxHero

    Joined:
    Dec 24, 2020
    Posts:
    1
    upload_2022-1-13_18-17-40.png
    for anyone having trouble finding the setting
     
  7. roguedagger

    roguedagger

    Joined:
    Jul 11, 2018
    Posts:
    5
    You still should not have to disable compression, that makes web files WAY too big. I am having the same problem, so I'll update if I find a solution that allows compression.
     
    godthekid likes this.
  8. unitygamedevloper48

    unitygamedevloper48

    Joined:
    Apr 9, 2022
    Posts:
    1
    If there is a same setting, then an error occurs
     
  9. ImOneIvan

    ImOneIvan

    Joined:
    Feb 11, 2022
    Posts:
    2
    I have the same problem.
    And I found out that if I create a 3D project, I don't have this error.
     
    heartingNinja likes this.
  10. ccfoo242

    ccfoo242

    Joined:
    Oct 9, 2014
    Posts:
    81
    Changing the compression to gzip under Publising Settings -> Compression Format solved this problem for me. Found solution HERE.
     
  11. Ottobed

    Ottobed

    Joined:
    Jul 6, 2020
    Posts:
    3
  12. SavedByZero

    SavedByZero

    Joined:
    May 23, 2013
    Posts:
    120
    No good -- this didn't fix it for me in unity 2020.3. The only thing that works is actually disabling compression -- neither format works on dreamhost.
     
    Last edited: Oct 5, 2022
    monoganog and alekpanc like this.
  13. ccfoo242

    ccfoo242

    Joined:
    Oct 9, 2014
    Posts:
    81
    I was using 2021.x
    Sucks that you have to disable compresw. I imagine that slows down the initial load time.
     
  14. SavedByZero

    SavedByZero

    Joined:
    May 23, 2013
    Posts:
    120
    Maybe it’s a dreamhost thing? But yeah, WebGL has always been very slow for us.
     
  15. nonbeing

    nonbeing

    Joined:
    Oct 14, 2022
    Posts:
    1
    Using 'zip' compression is working fine for me (2022.1) on itch.io - thanks for this solution.
     
    DBarlok, heartingNinja and Mikael-H like this.
  16. heartingNinja

    heartingNinja

    Joined:
    Mar 26, 2015
    Posts:
    9
    Compression Format seems to be set to "Brotli" by default. Changing to disable worked for me. But changing the format to "Gzip" also worked. I am using a .zip file to upload to Itch.
     
    DBarlok likes this.
  17. khrlazm

    khrlazm

    Joined:
    May 12, 2021
    Posts:
    1
    GZIP works.

    Thank you and have a good one
     
    heartingNinja likes this.
  18. gibrel

    gibrel

    Joined:
    Jan 4, 2013
    Posts:
    1
    Hello everyone.

    I had the same problem, but the solution I used was to enable Decompression Fallback over Publishing Settings.

    upload_2023-2-27_11-55-15.png

    Like in this video:
     
    DBarlok likes this.
  19. ib_magar

    ib_magar

    Joined:
    Jan 2, 2022
    Posts:
    2
    Don't know how, but changing the compression format to disabled worked for me.
     

    Attached Files:

  20. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,750
    That means your compression is not supported by the target web server (they havent setup their headers etc correctly to handle brotli/gzip)

    You can get around this by checking "decompression fallback", rather than selecting no compression.
     
  21. Zain_javaid55

    Zain_javaid55

    Joined:
    Aug 25, 2021
    Posts:
    1
    It worked. Thank you!
     
  22. RaduC94

    RaduC94

    Joined:
    Mar 20, 2023
    Posts:
    1
    You are a life saver! Thank you for your time to post your solution! ^^
     
  23. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    317
    This thread is like watching a lamp catch flies...

    Y'all do know that disabling compression doesn't fix the fact that your server is misconfigured to handle gzip/brotli right?
     
  24. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    182
  25. Jaehaerys3301

    Jaehaerys3301

    Joined:
    Mar 25, 2023
    Posts:
    1
    the compression disabling fixed it thanks!
     
  26. bin-debug

    bin-debug

    Joined:
    Dec 25, 2022
    Posts:
    1
    I ran into the same problem now and done some stackoverflows and research on the forums. The error I am getting is :

    Unable to parse Build/PROJECTNAME.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.

    Unity Version : 2022.2.0f1

    In the publish settings settings I have tried all 3 compression formats Brotli, gzip and none. With toggling decompression fallback on/off. I also enabled Developer Build. Nothing I try works :(

    I am trying to get working in github pages. I also found a link on the unity docs where I created web.config files in the build folder and also uploaded that to github pages, nothing works.

    I tried it locally by running python -m http.server, that also does not work because it needs an http(s) server for some reason.

    Is there anything else I can try please, I dont want to create a new ticket so I am hoping somebody does pick this up...
     
  27. Tom02039

    Tom02039

    Joined:
    Oct 6, 2022
    Posts:
    1
    Thanks, this work