unity 发布WebGL报错:Unable to parse Build/*.framework.js.gz! This can happen if build compression was en

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录


前言

原著链接:

报错:Unable to parse Build/*.framework.js.gz! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header “Content-Encoding: gzip” present. Check browser Console and Devtools Network tab to debug.
在这里插入图片描述
解决方法,在Unity的WebGL Player Settings中的Publishing settings选项卡中,把Decompression Fallback 选项勾上即可
打过的包要删除,而不是覆盖,否则依然会报这个错
在这里插入图片描述

总结

记录一下

有错误,Build5.framework.js.gz:1 Uncaught SyntaxError: Invalid or unexpected token (at Build5.framework.js.gz:1:1)了解此错误AI Build5.loader.js:1 Unable to parse Build/Build5.framework.js.gz! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: gzip" present. Check browser Console and Devtools Network tab to debug. c @ Build5.loader.js:1 i.onload @ Build5.loader.js:1 script (匿名) @ Build5.loader.js:1 x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 Failed to parse binary data file Build/Build5.data.gz (with "Content-Type: application/octet-stream, application/octet-stream"), because it is still gzip-compressed. It should have been uncompressed by the browser, but it was unable to do so since the web server provided the compressed content without specifying the HTTP Response Header "Content-Encoding: gzip" that would have informed the browser that decompression is needed. Please verify your web server hosting configuration to add the missing "Content-Encoding: gzip" HTTP Response Header. c @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 Malformed data? Downloaded binary data file Build/Build5.data.gz (ArrayBuffer size: 77035852) and browser should have decompressed it, but it might have not. Dumping raw HTTP Response Headers if it might help debug: (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 accept-ranges: bytes (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 cache-control: max-age=315360000 (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 connection: keep-alive (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 content-length: 77035852 (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 content-type: application/octet-stream, application/octet-stream (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 date: Thu, 06 Mar 2025 02:16:53 GMT (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 etag: "67c8197a-497794c" (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 expires: Thu, 31 Dec 2037 23:55:55 GMT (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 last-modified: Wed, 05 Mar 2025 09:29:30 GMT (匿名) @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 Promise.then x @ Build5.loader.js:1 (匿名) @ Build5.loader.js:1 createUnityInstance @ Build5.loader.js:1 (匿名) @ (索引):27了解此错误AI Build5.loader.js:1 server: nginx/1.27.1
03-08
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

野区捕龙为宠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值