cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

编译好后的项目在微信小游戏开发者工具编译失败,场景运行报错无法进入

Open WisdomZhi opened this issue 6 months ago • 0 comments

Cocos Creator version

3.8.6

System information

window11

Issue description

  1. 编译失败:报错project.config.json: libVersion 字段需为 string, string
  2. 运行失败:报错web-adapter.js:formatted:4614 Read file failed: path: subpackages/main/import/fe/fee82034-ad09-4844-b213-53bf1aebc58a.bin message: readFile:fail Parameter check error: parameter.encoding 字段需为 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'ucs-2' | 'ucs2' | 'utf-16le' | 'utf-8' | 'utf16le' | 'utf8' fail @ web-adapter.js:formatted:4614

Relevant error log output

Image Image Image Image Image

Steps to reproduce

环境:微信开发者工具版本:1.06.2503300 Windows 64

  1. 使用小游戏分包条件下编译后,在微信开发者工具编译失败,展示白屏
  2. 目前通过修改 project.config.json的"libVersion":"game" 为 "libVersion":"",可以解决这个编译失败问题
  3. 通过2解决后,再次运行场景时报错导致无法进入新场景,报错web-adapter.js:formatted:4614 Read file failed: path: subpackages/main/import/fe/fee82034-ad09-4844-b213-53bf1aebc58a.bin message: readFile:fail Parameter check error: parameter.encoding 字段需为 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'ucs-2' | 'ucs2' | 'utf-16le' | 'utf-8' | 'utf16le' | 'utf8' fail @ web-adapter.js:formatted:4614
  4. 目前通过将web-adapter.js中o.readFile({filePath:t,encoding:e,success:function(e){n&&n(null,e.data)},fail:function(e){console.warn("Read file failed: path: ".concat(t," message: ").concat(e.errMsg)),n&&n(new Error(e.errMsg),null)}中的 ,encoding:e,改成 encoding:e?e:undefined 后可以解决这个问题后正常运行

Minimal reproduction project

No response

WisdomZhi avatar May 21 '25 08:05 WisdomZhi