[WebGL] UnityLoader.js fails to parse on Chrome

Hey guys, looking for some help debugging what seems to be a Unity bug.

This may be some sort of Chrome flag that has changed as well, though I’ve verified that there have been no manually changed flags for the client that is having an issue. Its happening on several OSs as well.

I’m on Chrome 86.0.4240.111, and Unity version 2019.4.13f1.

I’m getting the following error when trying to load the UnityLoader.js file:

It’s hard to see what part of the code is failing to load, but from what I can tell the UnityLoader object is null.

Now for an interesting twist, I’m working with a guy who’s experiencing this issue. We are on the same Chrome version, he’s using an incognito window, (so no caching issues), and he crashes immediately with this error. I’m on the exact same version, and it works fine for me.

I’ve looked through his Local State file, and nothing looks particularly off between our setups. No flags are different between us. It just fails to compile the UnityLoader.js for some reason.

Any ideas would be helpful.

This is very likely due to the macOS Big Sur issue - see this forum thread: Bug? Generated UnityLoader.js fails in iOS 14 public beta

That has been fixed in latest alpha, and patches should be landing to other Unity branches very soon.

Can you try out doing a build in Unity 2021.1 alpha? Or try out a workaround in the above thread? Doing a Development build should give a clearer callstack about what is failing.

1 Like

That was my issue, I was able to verify that the edit to the trampoline worked as well. Though for those coming after me, make sure you edit the UnityLoader.min.js as well as the UnityLoader.js in the WebGL player.