Unity WebGL报错:HTTP Response Header “Content-Type“ configured incorrectly on the server for file

作者 : admin 本文共779个字,预计阅读时间需要2分钟 发布时间: 2024-06-16 共1人阅读

WebGL报错:HTTP Response Header “Content-Type” configured incorrectly on the server for file Build/KZ.wasm , should be “application/wasm”. Startup time performance will suffer.

在**.loader.js文件找到以下内容删除:console.error(e),”string”==typeof e&&e.indexOf(“wasm streaming compile failed”)!=-1&&(e.toLowerCase().indexOf(“mime”)!=-1?n(‘HTTP Response Header “Content-Type” configured incorrectly on the server for file ‘+c.codeUrl+’ , should be “application/wasm”. Startup time performance will suffer.’,”warning”):n(‘WebAssembly streaming compilation failed! This can happen for example if “Content-Encoding” HTTP header is incorrectly enabled on the server for file ‘+c.codeUrl+”, but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.”,”warning”))

下图所示:查找printErr:function 或 locateFile:function可定位

Unity WebGL报错:HTTP Response Header “Content-Type“ configured incorrectly on the server for file插图

本站无任何商业行为
个人在线分享-虚灵IT资料分享 » Unity WebGL报错:HTTP Response Header “Content-Type“ configured incorrectly on the server for file
E-->