Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: 重载 koishi-plugin-puppeteer出现报错 #1401

Open
CrystalSight opened this issue May 20, 2024 · 0 comments
Open

Bug: 重载 koishi-plugin-puppeteer出现报错 #1401

CrystalSight opened this issue May 20, 2024 · 0 comments
Labels
bug BUG

Comments

@CrystalSight
Copy link

Describe the bug

重载koishi-plugin-puppeteer出现报错

Steps to reproduce

更改koishi-plugin-puppeteer配置后重载,或停用后再启用

另:借曾经一个issues #1105中的代码进行了复现

Expected behavior

插件可正常运行

Screenshots

报错日志

2024-05-18 07:38:45 [E] app Error: service component:html has been registered
                            at Object.set (/koishi/node_modules/@cordisjs/core/lib/index.cjs:944:13)
                            at Proxy.component (/koishi/node_modules/@satorijs/core/lib/index.cjs:641:21)
                            at Puppeteer.start (/koishi/node_modules/koishi-plugin-puppeteer/lib/index.js:60:18)
                            at runNextTicks (node:internal/process/task_queues:60:5)
                            at process.processImmediate (node:internal/timers:449:9)
                            at async /koishi/node_modules/@cordisjs/core/lib/index.cjs:1077:7

#1105中的复现代码

import { Context, Schema, h } from 'koishi'

export const name = 'checkbug'

export interface Config { }

export const Config: Schema<Config> = Schema.object({})

export function apply(ctx: Context) {
  ctx.component('raw', (attr, children, session) => {
    return h('text', { content: children.join('') })
  })
}

复现报错

2024-05-20 13:26:05 [I] loader apply plugin checkbug:j46b69
2024-05-20 13:26:12 [I] loader unload plugin checkbug:j46b69
2024-05-20 13:26:13 [I] loader apply plugin checkbug:j46b69
2024-05-20 13:26:13 [E] app Error: service component:raw has been registered
                            at Object.set (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\context.ts:238:13)       
                            at Proxy.component (D:\Doc\dev\koishi-app\node_modules\@satorijs\core\src\index.ts:155:21)
                            at Object.apply (D:\Doc\dev\koishi-app\external\checkbug\src\index.ts:10:7)
                            at MainScope.apply (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:395:26)    
                            at <anonymous> (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:422:49)        
                            at MainScope.ensure (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:151:18)   
                            at MainScope.start (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:422:12)    
                            at MainScope.init (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:201:12)     
                            at MainScope (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\scope.ts:340:12)
                            at Proxy.plugin (D:\Doc\dev\koishi-app\node_modules\cordis\node_modules\@cordisjs\core\src\registry.ts:163:15)

Versions

Chrome版本 124.0.6367.158(正式版本) (64 位)

System:
OS: Windows 11 10.0.22631
CPU: (20) x64 13th Gen Intel(R) Core™ i9-13900H

Binaries:
Node: 20.12.1
Yarn: 4.1.1

Koishi:
Core: 4.17.6
Console: 5.28.4

Additional context

No response

@CrystalSight CrystalSight added the bug BUG label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug BUG
Projects
None yet
Development

No branches or pull requests

1 participant