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

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

码农世界 2024-05-26 前端 80 次浏览 0个评论

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》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,80人围观)参与讨论

还没有评论,来说两句吧...

Top