Cocos微信开发者工具运行报错,加载资源,有大佬知道怎么解决吗

  • Creator 版本:

  • 目标平台:

  • 重现方式:

  • 首个报错:

  • 之前哪个版本是正常的:

  • 手机型号:

  • 手机浏览器:

  • 编辑器操作系统:

  • 重现概率:

![屏幕截图 2025-02-11 215139|569x500](upload://17jNDbln4gtWDzchumtdxXUzQ7P.png)readFile:fail Parameter check error:

parameter.encoding 字段需为 ‘ascii’ | ‘base64’ | ‘binary’ | ‘hex’ | ‘latin1’ | ‘ucs-2’ | ‘ucs2’ | ‘utf-16le’ | ‘utf-8’ | ‘utf16le’ | ‘utf8’ Error: readFile:fail Parameter check error:
parameter.encoding 字段需为 ‘ascii’ | ‘base64’ | ‘binary’ | ‘hex’ | ‘latin1’ | ‘ucs-2’ | ‘ucs2’ | ‘utf-16le’ | ‘utf-8’ | ‘utf16le’ | ‘utf8’
at Object.fail (http://127.0.0.1:29567/game/web-adapter.js:3361:105)
at Object.t (http://127.0.0.1:29567/game/dev/WAGameSubContext.js:1:156832)
at Function.C.forEach.v. (http://127.0.0.1:29567/game/dev/WAGame.js:1:1333711)
at p (http://127.0.0.1:29567/game/dev/WAGame.js:1:195706)
at Object.fail (http://127.0.0.1:29567/game/dev/WAGame.js:1:196149)
at http://127.0.0.1:29567/game/dev/WAGame.js:1:460732
at ne (http://127.0.0.1:29567/game/dev/WAGame.js:1:460884)
at http://127.0.0.1:29567/game/dev/WAGame.js:1:461079
at r (http://127.0.0.1:29567/game/dev/WAGame.js:1:454444)
at s (http://127.0.0.1:29567/game/dev/WAGame.js:1:111227)(env: Windows,mg,1.06.2502102; lib: 3.7.7)
X @ _virtual_cc-Cf8s44g4.js:2
onComplete @ _virtual_cc-Cf8s44g4.js:2
e.dispatch @ _virtual_cc-Cf8s44g4.js:2
(anonymous) @ _virtual_cc-Cf8s44g4.js:2
(anonymous) @ _virtual_cc-Cf8s44g4.js:2
(anonymous) @ _virtual_cc-Cf8s44g4.js:2
fail @ web-adapter.js? [sm]:1
2_virtual_cc-Cf8s44g4.js:2 readFile:fail Parameter check error:
parameter.encoding 字段需为 ‘ascii’ | ‘base64’ | ‘binary’ | ‘hex’ | ‘latin1’ | ‘ucs-2’ | ‘ucs2’ | ‘utf-16le’ | ‘utf-8’ | ‘utf16le’ | ‘utf8’ Error: readFile:fail Parameter check error:
parameter.encoding 字段需为 ‘ascii’ | ‘base64’ | ‘binary’ | ‘hex’ | ‘latin1’ | ‘ucs-2’ | ‘ucs2’ | ‘utf-16le’ | ‘utf-8’ | ‘utf16le’ | ‘utf8’
at Object.fail (http://127.0.0.1:29567/game/web-adapter.js:3361:105)
at Object.t (http://127.0.0.1:29567/game/dev/WAGameSubContext.js:1:156832)
at Function.C.forEach.v. (http://127.0.0.1:29567/game/dev/WAGame.js:1:1333711)
at p (http://127.0.0.1:29567/game/dev/WAGame.js:1:195706)
at Object.fail (http://127.0.0.1:29567/game/dev/WAGame.js:1:196149)
at http://127.0.0.1:29567/game/dev/WAGame.js:1:460732
at ne (http://127.0.0.1:29567/game/dev/WAGame.js:1:460884)
at http://127.0.0.1:29567/game/dev/WAGame.js:1:461079
at r (http://127.0.0.1:29567/game/dev/WAGame.js:1:454444)
at s (http://127.0.0.1:29567/game/dev/WAGame.js:1:111227)(env: Windows,mg,1.06.2502102; lib: 3.7.7)

同学,你这没头没尾的,好难猜呀 :broken_heart:

不知道加载的什么类型资源?web-adapter.js中确实有一处readArrayBuffer 调用的 fsUtils.readFile 第二参很奇怪。fsUtils.readFile(filePath, ‘’, onComplete);改fsUtils.readFile(filePath, undefined, onComplete); 试试看呢(

一模一样,现在都是这个问题
image

看看是不是这个

是的,开发者工具的问题