Search Unity

Resolved Unable to parse Build/HTML5.framework.js.gz! - Need Help...

Discussion in 'Web' started by FallenAngelSoftware, Mar 28, 2021.

  1. FallenAngelSoftware

    FallenAngelSoftware

    Joined:
    Aug 12, 2018
    Posts:
    58
    Hi,

    Just built WebGL demo and uploaded to a website, but get below error:
    Completely new to Unity Engine, any help would be appreciated, thanks!

    Jesse
     
  2. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    288
  3. FallenAngelSoftware

    FallenAngelSoftware

    Joined:
    Aug 12, 2018
    Posts:
    58
    That worked, many thanks!
     
  4. DoozyKiddo

    DoozyKiddo

    Joined:
    Nov 5, 2021
    Posts:
    1
    Hello there, I got the same error and am a little confused as to where the code that gtk2k referenced should go. I see that it is supposed to be configure the WebGL server, but I don't know what to do with it or where to add it. I am new to using Unity, would appreciate any support!
     
    Fenikkel and legitlinus like this.
  5. Karsten

    Karsten

    Joined:
    Apr 8, 2012
    Posts:
    187
    NOT RESOLVED : Not working with a 2020.3.21f1 gzip build on IIS placing the web.config as described in the docs, same error

    IIS URL rewrite also says the XML isnt well formed, the code in the docs is trash
     
    Last edited: Nov 17, 2021
  6. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    getitng this too, i tried making the files suggested in the link and placing them in the path suggested, nothing happened is there more to it than this?

    after hat red error became yellow and said
    HTTP Response Header "Content-Type" configured incorrectly on the server for file Build/html5.wasm.gz , should be "application/wasm". Startup time performance will suffer.

    I still dont see any loading bar downloading my game though.
     
  7. Gerosaurus

    Gerosaurus

    Joined:
    Dec 31, 2021
    Posts:
    1
    As I could not get my web server to work with the .htaccess given above, I decompressed the files. (here _WebGLBuild is related to my build)

    gzip -d _WebGLBuild.framework.js.gz
    gzip -d _WebGLBuild.wasm.gz
    gzip -d _WebGLBuild.data.gz


    and edited the index.html file, removing the ".gz".

     
    var buildUrl = "Build";
    var loaderUrl = buildUrl + "/_WebGLBuild.loader.js";
    var config = {
    dataUrl: buildUrl + "/_WebGLBuild.data",
    frameworkUrl: buildUrl + "/_WebGLBuild.framework.js",
    codeUrl: buildUrl + "/_WebGLBuild.wasm",
    streamingAssetsUrl: "StreamingAssets",
    companyName: "DefaultCompany",
    productName: "Hero Born",
    productVersion: "0.1",
    showBanner: unityShowBanner,
    };


    it takes way more space, but it worked.
     
    radiantboy likes this.
  8. ninetontruck

    ninetontruck

    Joined:
    Nov 2, 2021
    Posts:
    1
    Experiencing the same error. Added "Content-Encoding:gzip" for each .gz fiels in my AWS S3 static website but it shows the same error in my Oculus Firefox. My Mac browser works fine tho
     
    kosted likes this.
  9. JeremyBradbury

    JeremyBradbury

    Joined:
    Jan 23, 2022
    Posts:
    1
    So no config notes for Nginx? Just the 2 worst performing & hardest to configure web servers instead?

    Seems like others have solved this, why not put this vital data into the docs?

    Also wanna note, in my case, the gz file is loaded into my browser cache without error, yet still displays the same error (OP) in the browser.
     
    Last edited: Jan 23, 2022
    unity_7JndxSaDfDSu5w likes this.
  10. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    Fenikkel and Marc-Saubion like this.
  11. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    Try Player setting -> WebGL -> Publish settings -> Compression = disabled.
     
  12. scotteza

    scotteza

    Joined:
    Sep 6, 2020
    Posts:
    1
    This worked for me when hosting on GitHub pages, thank you @Steedalion!
     
    inin13 and restush96 like this.
  13. bnika14

    bnika14

    Joined:
    Aug 19, 2022
    Posts:
    3

    Attached Files:

  14. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    288
    As the error message says, open DevTools (in Chrome), open the Network tab, and try reloading the page. And check what kind of error you get when you access scoresquasher.framework.js.
     
  15. jason39259

    jason39259

    Joined:
    May 7, 2022
    Posts:
    1
  16. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Anybody figure out how to configure Vercel to properly serve gzip or brotli?
    They talk about compression here https://vercel.com/docs/concepts/edge-network/compression but I can't see how to configure it as per https://docs.unity3d.com/Manual/webgl-server-configuration-code-samples.html

    For now I've disabled compression, which is ok for testing but not a good idea for production.

    Any vercel experts out there?

    Have a reliable deployment system that covers all these options for webgl would help a lot of people atm, I think.
     
    Pullahs likes this.
  17. kenthalazo

    kenthalazo

    Joined:
    Mar 4, 2022
    Posts:
    4
    Looks like you're right without compression seems perfectly fine but I can't ignore the fact that it takes much more dn also while setting the server in vscode using Live Server I can't seem to modify the be or gz files or reception of such, maby my lack of knowledge...
     
  18. Larch

    Larch

    Joined:
    Jul 4, 2013
    Posts:
    1
    I used vercel.json to config the headers and it works well.
    Code (JavaScript):
    1. {
    2.   "headers": [
    3.     {
    4.       "source": "/Build/:name.data.br",
    5.       "headers": [
    6.         {
    7.           "key": "Content-Encoding",
    8.           "value": "br"
    9.         },
    10.         {
    11.           "key": "Content-Type",
    12.           "value": "application/octet-stream"
    13.         }
    14.       ]
    15.     },
    16.     {
    17.       "source": "/Build/:name.wasm.br",
    18.       "headers": [
    19.         {
    20.           "key": "Content-Encoding",
    21.           "value": "br"
    22.         },
    23.         {
    24.           "key": "Content-Type",
    25.           "value": "application/wasm"
    26.         }
    27.       ]
    28.     },
    29.     {
    30.       "source": "/Build/:name.js",
    31.       "headers": [
    32.         {
    33.           "key": "Content-Encoding",
    34.           "value": "js"
    35.         },
    36.         {
    37.           "key": "Content-Type",
    38.           "value": "application/javascript"
    39.         }
    40.       ]
    41.     },
    42.     {
    43.       "source": "/Build/:name.js.br",
    44.       "headers": [
    45.         {
    46.           "key": "Content-Encoding",
    47.           "value": "br"
    48.         },
    49.         {
    50.           "key": "Content-Type",
    51.           "value": "application/javascript"
    52.         }
    53.       ]
    54.     }
    55.   ]
    56. }
    57.  
     
    Skibitsky likes this.
  19. Skibitsky

    Skibitsky

    Joined:
    Mar 22, 2016
    Posts:
    24
    Thanks!

    For everyone else, this json works with Brotli compression. To use it with gzip make sure to update source extensions and header values:
    file extensions: .br → .gz
    header values: br → gzip