batu1579 / hamibot-starter

一个快速开始用 TypeScript 编写 Hamibot 脚本的模板
Mozilla Public License 2.0
96 stars 145 forks source link

[QUESTION] #15

Open chance30 opened 1 year ago

chance30 commented 1 year ago

你遇到的问题 清晰而简洁的 描述一下你遇到的问题。 编译上传 运行 以后 日志里面报错 the ‘show console’ field in the configuration is invalid

batu1579 commented 1 year ago

现在应该已经修复辣~

spirit223 commented 1 year ago

fork这个仓库后直接打包还是会出现 The 'show console' field in the configuration is invaild 这个控制台检查是无法绕过的吗,我检查了我的config.json里面json数组第二个对象的"value"字段是true, 并且我的hamibot悬浮窗权限已经开始并可以正常使用hamibot悬浮球 如果不可绕过那我应该通过什么办法才能够正常运行脚本?

batu1579 commented 1 year ago

抱歉我才看到,我这里是可以正常使用的。你试试用那个VSCode的插件直接创建项目,我刚新建了一个跑起来是没有报错的。

// index.ts 中的代码
import {} from "./global";
import { init } from "./lib/init";

init();

log(hamibot.env)

image

但是好像默认值的设置有问题,我正在检查。

batu1579 commented 1 year ago

现在应该没有问题了,我调整了默认值的字段(问了一下才知道默认值的字段是 default QAQ)

spirit223 commented 1 year ago

十分感谢🥰

wanafan commented 1 year ago

17:42:08.075/E: Error: The 'SHOW CONSOLE' field in the configuration is invalid, undefined. please check it again ! (6534c6390cfca0f22cbca128.js#763) Error: The 'SHOW CONSOLE' field in the configuration is invalid, undefined. please check it again ! at 6534c6390cfca0f22cbca128.js:763:0 at 6534c6390cfca0f22cbca128.js:4:0

貌似和前面的大哥一样错误,使用的都是最新的软件版本

jianghaodn commented 11 months ago

17:42:08.075/E: Error: The 'SHOW CONSOLE' field in the configuration is invalid, undefined. please check it again ! (6534c6390cfca0f22cbca128.js#763) Error: The 'SHOW CONSOLE' field in the configuration is invalid, undefined. please check it again ! at 6534c6390cfca0f22cbca128.js:763:0 at 6534c6390cfca0f22cbca128.js:4:0

貌似和前面的大哥一样错误,使用的都是最新的软件版本

我之前也是这个错误,然后我修改了global.ts当中的部分判断,让它不要去检查就行了。新版的我还没用

PanYuntao commented 1 month ago

新拉的的代码遇到同样的问题,除了修改global.ts判断还有啥别的方式吗

batu1579 commented 1 month ago

新拉的的代码遇到同样的问题,除了修改global.ts判断还有啥别的方式吗

可以查看一下配置文件中“显示控制台“字段的默认值具体是什么。

我记得之前测试这个问题被修好了哇QAQ

PanYuntao commented 1 month ago

是不是配置的不对?global中_SHOW_CONSOLE还是获取不到,我这样配置的: