Hello,
I’m testing out 5.6 WebGL + WebAssembly in hopes to get a quicker load time for my game. The local build works fine, but as soon as I serve it through IIS, I get an error:
I guess this has something to do with the server configuration? Previous similar errors have been fixed by setting mimeMaps in the web.config file.
The function in question is here:
instantiate: function(e, t, r) {
function n(e, r) {
if (“string” == typeof e && !(e = document.getElementById(e))) return !1;
e.innerHTML = “”, e.style.border = e.style.margin = e.style.padding = 0, “static” == getComputedStyle(e).getPropertyValue(“position”) && (e.style.position = “relative”), e.style.width = r.width || e.style.width, e.style.height = r.height || e.style.height, r.container = e;
var n = r.Module;
return n.canvas = document.createElement(“canvas”), n.canvas.style.width = “100%”, n.canvas.style.height = “100%”, n.canvas.addEventListener(“contextmenu”, function(e) {
e.preventDefault()
}), n.canvas.id = “#canvas”, e.appendChild(n.canvas), UnityLoader.compatibilityCheck(r, function() {
var t = new XMLHttpRequest;
t.open(“GET”, r.url, !0), t.responseType = “text”, t.onload = function() {
var r = JSON.parse(t.responseText); // ← This line
for (var o in r) “undefined” == typeof n[o] && (n[o] = r[o]);
e.style.background = n.backgroundUrl ? “center/cover url('” + n.resolveBuildUrl(n.backgroundUrl) + “')” : n.backgroundColor ? " " + n.backgroundColor : “”, UnityLoader.loadModule(n)
}, t.send()
}, function() {
console.log(“Instantiation of the '” + t + “’ terminated due to the failed compatibility check.”)
}), !0
}
Could you point me to the correct JSON file and how it should be encoded to be correctly parsed by Unity?