1、报错内容
Unable to parse Build/test.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.
2、报错页面
解决方案,在Unity的WebGL Player Settings中的Publishing settings选项卡中,把Decompression Fallback 选项勾上即可。
2.Decompression Fallback 的官方API地址:Unity - Manual: WebGL Player settings
解释内容:
Include decompression fallback code for build files in the loader. Use this option if you aren’t able to configure server response headers according to the selected compression method. |
更新后 build 可以正常加载