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

404 .js file not found with Safari on itch.io

Discussion in 'Web' started by Rostam24, Mar 8, 2016.

  1. Rostam24

    Rostam24

    Joined:
    Mar 5, 2014
    Posts:
    119
    For some reason the WebGL build of my game does not work (stuck loading) on safari on itch.io:
    https://taidowarrior.itch.io/webdemo

    I receive the following error in the javascript console:
    [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (Android.js, line 0)

    It's strange, because when I upload the WebGL files to my own server, it does work. My first thought was that something was wrong with the itch.io server, but I've contacted them and they don't know.

    So, anyone here have any ideas...? I hope so! Thank you for your time :)
     
  2. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello Rostam24.

    The 404 Errors for js/data/mem files are expected. Unity loader first tries to load WebGL resources in compressed form without gz suffix and with Content-Encoding: gzip response header provided, in which case they will be decompressed by the browser during download. And if such form is not provided by the server (like in your case) the loader will first receive 404 and then fallback to downloading the compressed file directly and decompressing it in JavaScript. Except a small delay during the loading process, the game should work as expected.

    When you upload the WebGL files to your own server, the .htaccess takes care of the response headers properly, so the loader does not receive 404.
     
    Last edited: Mar 9, 2016
    Rostam24 likes this.
  3. Rostam24

    Rostam24

    Joined:
    Mar 5, 2014
    Posts:
    119
    Thank you very much for that explanation! Guess that means the problem is probably on my end.