如何解决 WebGL Unity 游戏中的这个错误?

How can I solve this error in WebGL Unity game?

我不知道为什么会收到此错误。在 WebGL 中构建我的项目并在 itch.io 游戏 window 中启动它(在 Chrome 中)它显示此消息,游戏无法 运行:

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: uncaught exception: abort(180) at jsStackTrace (WebGL.wasm.framework.unityweb:8:22313) stackTrace (WebGL.wasm.framework.unityweb:8:22484) onAbort@file:///C:/Users/wujtm_000/Desktop/WebGL/Build/UnityLoader.js:4:11118 abort (WebGL.wasm.framework.unityweb:8:483539) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[45753]:0xda48f7 (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[22089]:0x9023d7) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[24498]:0x95f899 (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[22992]:0x93c06c) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[45533]:0xda3cc0 UnityModule [UnityModule/Module.dynCall_iiiii] (WebGL.wasm.framework.unityweb:8:458801) invoke_iiiii (WebGL.wasm.framework.unityweb:8:335855) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[43654]:0xd4f185 (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[43125]:0xd37edc) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[4225]:0x18b90c (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[4224]:0x18b835) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10198]:0x3c205a (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10182]:0x3c0d4e) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[12109]:0x4b637b (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[12108]:0x4b6095) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10577]:0x3ed282 (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10288]:0x3caa9b) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10288]:0x3caab0 (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10283]:0x3ca5ba) @blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[10276]:0x3c881e (blob:null/721358bf-caaa-4408-babf-350932a4b11a line 8 > WebAssembly.instantiate:wasm-function[45547]:0xda3ef2) UnityModule [UnityModule/Module.dynCall_v] (WebGL.wasm.framework.unityweb:8:467249) browserIterationFunc (WebGL.wasm.framework.unityweb:8:175900) runIter (WebGL.wasm.framework.unityweb:8:178973) Browser_mainLoop_runner (WebGL.wasm.framework.unityweb:8:177435)

网络控制台错误:

Invoking error handler due to Uncaught abort(180) at Error at jsStackTrace (WebGL.wasm.framework.unityweb:8:22313) at stackTrace [Object.stackTrace] (WebGL.wasm.framework.unityweb:8:22484) at Object.onAbort (https://v6p9d9t4.ssl.hwcdn.net/html/2312897/WebGL/Build/UnityLoader.js:4:11118) at abort (WebGL.wasm.framework.unityweb:8:483549) at :wasm-function[45753]:0xda48f7 at :wasm-function[22089]:0x9023d7 at :wasm-function[24498]:0x95f899 at :wasm-function[22992]:0x93c06c at dynCall_iiiii (:wasm-function[45533]:0xda3cc0) at dynCall_iiiii [Object.dynCall_iiiii] (WebGL.wasm.framework.unityweb:8:458801) at invoke_iiiii (WebGL.wasm.framework.unityweb:8:335871) at :wasm-function[43654]:0xd4f185 at :wasm-function[43125]:0xd37edc at :wasm-function[4225]:0x18b90c at :wasm-function[4224]:0x18b835 at :wasm-function[10198]:0x3c205a at :wasm-function[10182]:0x3c0d4e at :wasm-function[12109]:0x4b637b at :wasm-function[12108]:0x4b6095 at :wasm-function[10577]:0x3ed282 at :wasm-function[10288]:0x3caa9b at :wasm-function[10288]:0x3caab0 at :wasm-function[10283]:0x3ca5ba at :wasm-function[10276]:0x3c881e at dynCall_v (:wasm-function[45547]:0xda3ef2) at dynCall_v [Object.dynCall_v] (WebGL.wasm.framework.unityweb:8:467249) at browserIterationFunc (WebGL.wasm.framework.unityweb:8:175912) at runIter [Object.runIter] (WebGL.wasm.framework.unityweb:8:178973) at Browser_mainLoop_runner (WebGL.wasm.framework.unityweb:8:177435) DevTools failed to load SourceMap: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME DevTools failed to load SourceMap: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.postload.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8 Uncaught abort(180) at Error at jsStackTrace (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:22313) at Object.stackTrace (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:22484) at Object.onAbort (https://v6p9d9t4.ssl.hwcdn.net/html/2312897/WebGL/Build/UnityLoader.js:4:11118) at abort (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:483549) at :wasm-function[45753]:0xda48f7 at :wasm-function[22089]:0x9023d7 at :wasm-function[24498]:0x95f899 at :wasm-function[22992]:0x93c06c at dynCall_iiiii (:wasm-function[45533]:0xda3cc0) at Object.dynCall_iiiii (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:458801) at invoke_iiiii (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:335871) at :wasm-function[43654]:0xd4f185 at :wasm-function[43125]:0xd37edc at :wasm-function[4225]:0x18b90c at :wasm-function[4224]:0x18b835 at :wasm-function[10198]:0x3c205a at :wasm-function[10182]:0x3c0d4e at :wasm-function[12109]:0x4b637b at :wasm-function[12108]:0x4b6095 at :wasm-function[10577]:0x3ed282 at :wasm-function[10288]:0x3caa9b at :wasm-function[10288]:0x3caab0 at :wasm-function[10283]:0x3ca5ba at :wasm-function[10276]:0x3c881e at dynCall_v (:wasm-function[45547]:0xda3ef2) at Object.dynCall_v (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:467249) at browserIterationFunc (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:175912) at Object.runIter (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:178973) at Browser_mainLoop_runner (blob:https://v6p9d9t4.ssl.hwcdn.net/cf55a5c5-c403-41ef-aab8-de035b7ea92b:8:177435) DevTools failed to load SourceMap: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME DevTools failed to load SourceMap: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.postload.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME 29cf55a5c5-c403-41ef-aab8-de035b7ea92b:8 An abnormal situation has occurred: the PlayerLoop internal function has been called recursively. Please contact Customer Support with a sample project so that we can reproduce the problem and troubleshoot it. (Filename: Line: 377)

如果需要Unity Launcher js。 code - 我不能在这里涉及它,因为它有太多字母,priv.


我尝试过的事情:

请帮忙!!!

不确定这是否仍然重要,但无论如何这是一个答案。我们能够确保此问题几乎不再发生。我们仍在考虑加强这一点,因为无论如何都会不时弹出错误。

1。在 Unity 中

  • 确保更新 Unity。上一个版本似乎处理得更好。
  • 分配更多内存。在我们特定的 use-case 中,我们真的可以使用更多内存 (-s WASM_MEM_MAX=1024MB)。

2。在 JS

  • 我们确保每次都退出 Unity(在我们的 Angular SPA 中!)。由于有一个service worker可以很容易地再次为Unity服务,所以我们总是删除实例。

    this.gameInstance
        .Quit()
        .then(() => {
            // Do whatever your app needs here
            this.gameInstance = null;
            this.playState$.next(null);
        })
        .catch(() => {
        console.log("Quitting Unity wasn't a success ");
        });

这让事情变得更加稳定。希望对你有帮助。

我忘记了这个 post 但现在回答它,这样如果有人再次遇到这个问题就不会那么混乱了。我基本上在游戏中使用了 dreamlo 自定义排行榜,但由于一个简单的原因它崩溃了。 WebGL 需要付费 SSL,而我完全没有抓住要点。阿呆.

如果这些天有人像我一样迷路了,希望我能帮助他们...