I just updated Unity to 2019.1.5f1 from 2018.2.5f1 and built the project for WebGL.
In 2018 it builds and runs on webGL fine with no errors, however, after this build I’m getting this error when I run it (90% loaded):
Uncaught TypeError: Cannot redefine property: asmLibraryArg
I looked everywhere and can’t find the cause for this. Any ideas? It’s never had this error before, and I didn’t make any changes other than updating Unity.
(Not sure if related)
I’m using a few some javascript files such as this one that need to be in the program.
Nope. I had to revert back to my older Unity version.
I tried all sorts of things to no avail. No idea what’s causing it or how to fix it. I wish someone could help still. I would really love to upgrade to 2019.
I’m having this issue too. I was wondering if maybe it is something to do with the differences between asmJS and WebAssembly that you could switch between in 2018.2? but I can’t find the option to modify this in the player settings any more…
I found a solution to this issue where you can still use unity 2019 and Unity-WebGL-Utilities plugin
if you just comment out the problematic if statement :
Object.defineProperty(Module, "asmLibraryArg", {
get: function () { return Module.realAsmLibraryArg; },
set: function (value) {
if (typeof value == "object" && typeof value._JS_WebRequest_Create == "function")
value._JS_WebRequest_Create = CachedXMLHttpRequest.wrap(value._JS_WebRequest_Create);
Module.realAsmLibraryArg = value;
},
});
}
the plugin will still work and the build will run as usual.
not sure whats going on there but it is possible that in 2019 Unity take care of this on their side so the plugin still works even tho the property is no longer available
This discussion talks about needing to remove the Unity-WebGL-Utilities plugin. But I just wanted to add an important addition to this solution that I read from mhama over on GitHub: You also need to remove WebGLCachedXMLHttpRequest if you have it, because apparently Unity started including this plugin directly starting with 2019.