Hi there,
I tried to upload a prototype to Unity Play, but it won’t load for the following reason:
"Unable to load file https://play-static.unity.com/20210928/webgl/9bcee48a-a50b-4d06-b8ba-13f7e38fa479/Build/! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)"
The upload can be found at: https://play.unity.com/mg/other/uplayfirstattempt
The same build works fine on itch.io. I guess Unity Play is not using the index.html but tries to access the Build directly? Did something change in 2021.2 which makes it so tha Unity Play is not able to load the build correctly? The needed data fies are there if I directly access them with the browser. It just seems that Unity Play can’t find the correc file names, so that it tries to access the Build-folder instead of a file in the build folder?
I had a look at the config.json that seems to get added to the Build, and saw that dataUrl/frameworkUrl/codeUrl were not set. I created my own config.json, referencing the correct uris, and reuploaded it.
Now I get a new error message
"Uncaught ReferenceError: UnityLoader is not defined"
After having a look at Changes to the WebGL loader and templates introduced in Unity 2020.1 it looks to me as if UnityPlay is searching for the older way of loading the game. But the new way was introduced with 2020.1, so I guess UnityPlay should be compatible with it?
I might miss something obvious, so sorry if that’s the case.
Tried it now with 2020.3.19 (LTS), and I get the same error(s)
Getting closer…so the initial issue had to do with ‘wrong’ settings: I did build with ‘filenames as hashes’ and compression. After this did not work, I disabled both. But it looks like the ‘new’ Loader introduced with 2020.1 needs compression enabled.
When enabling compression again, but not enabling ‘filenames as hashes’ I got it working with v2020. But rebuilding with 2021.2 prompts me with yet another error message:
Uncaught DOMException: Document.querySelector: '##canvas' is not a valid selector
Just another progress update for anybody else who might stumble over this issue: I filed a bug report now. I played around with the build.framework.js and escaped the second ‘#’ (something like replacing ‘##canvas’ with ‘##canvas’).
This way, I got the build running on Unity Play. But it is probably not the best solution…hence the bug report.
Hi! was this ever resolved for you? I am currently working my way through the Unity Learn courses and am seeing some similar messages in dev tools whenever I try to play a game that I’ve published–it’ll get to 90% and then just stop on these errors.
This was fixed in 2021.2.13f1.
Haven’t tried it out yet, though
This error is happening on my 2021.3.13f1
My build is compressed gzip, can’t even manually edit the js