koishijs / cache

Cache Service | 缓存服务

Home Page:https://cache.koishi.chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: 擦车服务显示未加载

Lipraty opened this issue · comments

先启用任意擦车插件

image

在自己插件的 package.json 声明擦车:

/** package.json */
...
 "koishi": {
    ...
    "service": {
      "required": ["cache"]
    }
  },
...

然后就提示未加载:

image

阅读源码发现导出了名为 __cache__ 的服务:

constructor(ctx: Context) {
super(ctx, '__cache__')
}

将插件的 package.json 里 koishi.service 改为上述导出的服务后,console 能正确显示服务已加载

/** package.json */
...
 "koishi": {
    ...
    "service": {
      "required": ["__cache__"]
    }
  },
...

U6)CA1RC8}}IRCQ )2QWPOT


对服务类插件加载机制了解不深,是否是因为导出名的问题呢(

从 4.11.2 更新到 4.12.2 后发现问题已被修复,close 了(