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.
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.
Yeah so it seems like regardless of when I open an index.html file, it’s not going to work, but I finally got it to work on github pages (I was getting these errors still).