Search Unity

WebGL builds fail to produce TemplateData and index.html

Discussion in 'Linux' started by jusw85, May 8, 2019.

  1. jusw85

    jusw85

    Joined:
    Apr 21, 2016
    Posts:
    21
    As per topic.

    Running Arch Linux.
    Fresh install of UnityHub 1.6.2 from AUR.
    Installed and tested with both 2019.1.1f1 and 2018.3.14f1 (with additional WebGL Build Support).
    Create a new empty project, switch to WebGL platform, add the default scene, then build. Player settings left as default.
    Result: Only the Build folder is generated (with all the .unityweb wasm files, Unityloader.js, etc. intact). There is no TemplateData folder nor index.html (as documented here).

    There are no errors produced. The console log produces:

    Same result when development build is checked. If I "build and run", it opens http://localhost:43643 with "404 Not found."

    Can anyone else repro this issue, or is it just me?

    (I have no issue building and running Linux standalone)
     
    Last edited: May 8, 2019
  2. jusw85

    jusw85

    Joined:
    Apr 21, 2016
    Posts:
    21
    I solved it with a workaround.

    Two methods:

    1. The default template files exist at <UnityInstallLocation>/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/WebGLTemplates/Default. Copy index.html and TemplateData into the output directory after building, then manually modify the template tags in index.html

    2. Create a custom WebGL template as documented here. First create WebGLTemplates folder in assets, then copy in the default WebGL template (from above location), or alternatively use your own custom template.

    I'm still not sure why the original issue is happening or how to solve it.
     
    bseslikaya, sunil10000 and HZ51 like this.
  3. sunil10000

    sunil10000

    Joined:
    May 6, 2020
    Posts:
    1
    Thanks for answering your own question. Your method helped me to solve the issue.
     
  4. bparag890

    bparag890

    Joined:
    Mar 10, 2022
    Posts:
    2
    how you solved the issue Sunil .? please share? i am unable to solve it still.