I’m progressing with converting my mobile game into WebGL and running it on dfx but I have a new problem: I have managed to get my project converted to a WebGL game and it runs successfully on the following:
Windows 11 - Chrome and Firefox using IIS
Ubuntu 20.04 - Chrome and Firefox using Apache2
I can also get the Unity sample project to run in dfx locally and in the browser. I got the instructions from these two links:
https://internetcomputer.org/docs/current/samples/host-unity-webgl/
https://github.com/dfinity/examples/tree/master/hosting/unity-webgl-template
What I can’t do is get any project, even a simple, brand new WebGL build running on Ubuntu 20.04 (Firefox or Chrome) to run using dfx locally. All I get is a black screen and the following error messages:
Uncaught SyntaxError: expected expression, got '<'DH_WebGL.loader.js:1
Uncaught ReferenceError: createUnityInstance is not defined
h_t_t_p://127.0.0.1:8000/?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai:27
Has anyone managed to create a brand new WebGL project and get it running on dfx locally without using the sample project? If so, which settings did you use besides setting the compression to “disabled” and the build to “minimal”.
The software versions are as follows:
Ubuntu 20.04
Unity3D 2022.1.20.f1