Search code examples
c#unityscriptunity-game-engineunity-webgl

Unity Webgl js File Not Found


I am working on some WebGL project and then I pushed my project on some webserver. When I open the website ( otom.playback.com.tr ) I took some errors like here below,

http://otom.playback.com.tr/Release/deneme.js Failed to load resource: the server responded with a status of 404 (Not Found)

http://otom.playback.com.tr/Release/deneme.jsgz Failed to load resource: the server responded with a status of 404 (Not Found)

UnityLoader.js:1 Uncaught incorrect header check

The first error says me deneme.js does not found in the webserver. But unity does not give me a js file. I added all files as mime type but still doesn't work.

What I must to do for this errors. Regards.


Solution

  • According to Unity's official documentation

    The Development or Release folder contains the following files (the MyProject file name represents the name of your project). (Note that if you make a release build, files in this folder are compressed and have a .gz suffix. See the comments on Distribution size below.)

    • A MyProject.js JavaScript file containing the code for your player.
    • A MyProject.mem file containing a binary image to initialize the heap memory for your player.
    • A MyProject.data file containing the asset data and scenes.
    • A UnityLoader.js file containing the code needed to load up the Unity content in the web page.le containing the code needed to load up the Unity content in the web page.
    • If your JS files are missing you should rebuild the Project and make sure it builds without any error.
    • Make sure your host allows access to JS files
    • Set up a local web server to test your Project easier/faster before deploying to the web

    More information can be found here: http://docs.unity3d.com/Manual/webgl-building.html