Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 2020.2 WebGL - both async and sync fetching of the wasm failed Error

Discussion in 'WebGL' started by ZachAttack9280, Dec 24, 2020.

  1. ZachAttack9280

    ZachAttack9280

    Joined:
    Sep 12, 2015
    Posts:
    18
    Hello, out of nowhere, I started getting these errors whenever I build for WebGL. I have no async related code as well. Also, I would like to know that the game runs perfectly fine if I do "Build and Run". But after that, if I were to open via index.html, it would produce that error which is an issue when it comes to publishing on Github Pages.

    What's going on?
    Thanks.


    More Errors: https://hatebin.com/jgndcqztfm
    upload_2020-12-23_21-20-34.png
     
  2. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    276
    When I open index.html from Explorer, I get the URL file://~ and the browser rejects this URL. As the error indicates, it works if you access it at http://~ or https://~. In other words, all you have to do is set up a Web Server. Build And Run of Unity is realized by automatically starting Web Sever with Node.js and accessing it from a browser.
    However, it may fail from time to time, so it is recommended to set up a separate Web Server.
     
  3. ZachAttack9280

    ZachAttack9280

    Joined:
    Sep 12, 2015
    Posts:
    18