Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Critical - 5.5.f03 breaks WebGL build -- incorrect header check

Discussion in 'Web' started by Charles-Van-Norman, Dec 29, 2016.

  1. Charles-Van-Norman

    Charles-Van-Norman

    Joined:
    Aug 10, 2010
    Posts:
    86
    [SOLVED] - My issue was because I hardcoded the values in a custom index.html, var Module = .., e.g.

    Code (JavaScript):
    1.          var Module = {
    2.             TOTAL_MEMORY: 536870912,
    3.         //  TOTAL_MEMORY: 268435456,
    4.             errorhandler: null,         // arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
    5.             compatibilitycheck: null,
    6.             dataUrl: "{{static_path}}/{{build_name}}/Release/{{build_name}}.data",
    7.             codeUrl: "{{static_path}}/{{build_name}}/Release/{{build_name}}.js",
    8.             memUrl: "{{static_path}}/{{build_name}}/Release/{{build_name}}.mem",
    9.           };
    which was missing the new ASM.js file which didn't exist before I updated to Unity 5.5.f03.

    What I learned: an "incorrect header check" will happen if you include the wrong files in var Module = {... or if you fail to include an expected file there

    [/SOLVED]

    With Unity 5.4 I could build to WebGL with gzip compression without issue.

    After upgrading to Unity 5.5.f03, I use exactly the same build pipeline as with 5.4 but now I get an "incorrect header check" error. This error appears only when I host the files on Amazon cloudfront and deliver to user via Apache running on EC2 machine

    Doesn't work:
    dev.supermathworld.com/play/
    Actions: Build with 5.5.f03, upload build folder to Amazon Cloudfront/S3, loaded via Apache server on an EC2 machine
    Tried: Reg build, Dev build, No exceptions, Handle explicit exceptions, and Handle all exceptions.
    Tried: Restarting Apache server
    Error: incorrect header check every time

    Works:
    supermathworld.com/play/
    Actions: Build with 5.4.x, upload build folder to Amazon Cloudfront/S3, loaded via Apache server on an EC2 machine

    Works:
    Run the build locally without hosting on my remote server setup

    Unity Support, what is causing this issue?

    Thanks,
     
    Last edited: Dec 29, 2016