koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.37k stars 239 forks source link

Bug: TypeError: Cannot read properties of undefined (reading 'ws') #1173

Closed Ice-Hazymoon closed 1 year ago

Ice-Hazymoon commented 1 year ago

Describe the bug

更新 koishi 及相关插件后出现下面的错误

2023-08-20 15:13:58 [W] app TypeError: Cannot read properties of undefined (reading 'ws')
                            at NodeConsole (E:\Project\bot\node_modules\@koishijs\plugin-console\src\node\index.ts:44:29)    
                            at _MainScope.apply (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:310:24) 
                            at _MainScope.start (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:333:12) 
                            at _MainScope.restart (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:72:10)
                            at _MainScope.setup (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:301:10) 
                            at MainScope (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:261:12)        
                            at _Registry.plugin (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\registry.ts:113:15)
                            at _Context.plugin (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\context.ts:81:30) 
                            at _Context.import_core.Context.plugin (E:\Project\bot\node_modules\koishi\src\index.ts:39:17)   
                            at _NodeLoader.forkPlugin (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:258:19)
                            at _NodeLoader.reloadPlugin (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:284:16)
                            at <anonymous> (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:77:9)
2023-08-20 15:13:58 [W] app TypeError: Cannot read properties of undefined (reading 'get')
                            at LocalAssets.initServer (E:\Project\bot\node_modules\koishi-plugin-assets-local\lib\index.js:71:25)
                            at new LocalAssets (E:\Project\bot\node_modules\koishi-plugin-assets-local\lib\index.js:34:18)   
                            at _MainScope.apply (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:310:24) 
                            at _MainScope.start (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:333:12) 
                            at _MainScope.restart (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:72:10)
                            at _MainScope.setup (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:301:10) 
                            at MainScope (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:261:12)        
                            at _Registry.plugin (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\registry.ts:113:15)
                            at _Context.plugin (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\context.ts:81:30) 
                            at _Context.import_core.Context.plugin (E:\Project\bot\node_modules\koishi\src\index.ts:39:17)   
                            at _NodeLoader.forkPlugin (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:258:19)
                            at _NodeLoader.reloadPlugin (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:284:16)
                            at <anonymous> (E:\Project\bot\node_modules\koishi\node_modules\@koishijs\loader\src\shared.ts:77:9)
2023-08-20 15:13:58 [W] app TypeError: Cannot read properties of undefined (reading 'all')
                            at _NodeConsole.createVite (E:\Project\bot\node_modules\@koishijs\plugin-console\src\node\index.ts:186:21)
                            at _NodeConsole.start (E:\Project\bot\node_modules\@koishijs\plugin-console\src\node\index.ts:59:30)
                            at <anonymous> (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\service.ts:21:7)      
                            at async Promise.all (index 40)
                            at _Lifecycle.flush (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\events.ts:73:7)  
                            at _Lifecycle.start (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\events.ts:169:5) 
                            at start (E:\Project\bot\node_modules\koishi\src\worker\index.ts:52:3)
2023-08-20 15:13:58 [W] app TypeError: Cannot read properties of undefined (reading 'close')
                            at _NodeConsole.stop (E:\Project\bot\node_modules\@koishijs\plugin-console\src\node\index.ts:194:16)
                            at event <dispose> (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\service.ts:27:18) 
                            at <anonymous> (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:133:7)       
                            at Array.filter (<anonymous>)
                            at _MainScope.reset (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:131:51) 
                            at _MainScope.reset (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:324:11) 
                            at _MainScope.cancel (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:109:10)                            at <anonymous> (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\scope.ts:96:14)       
                            at async Promise.all (index 40)
                            at _Lifecycle.flush (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\events.ts:73:7)  
                            at _Lifecycle.start (E:\Project\bot\node_modules\koishi\node_modules\cordis\src\events.ts:169:5) 
                            at start (E:\Project\bot\node_modules\koishi\src\worker\index.ts:52:3)

Steps to reproduce

如题

Expected behavior

如题

Screenshots

No response

Versions

        "@koishijs/plugin-adapter-discord": "^3.8.5",
        "@koishijs/plugin-adapter-lark": "2.1.3",
        "@koishijs/plugin-adapter-line": "1.1.1",
        "@koishijs/plugin-adapter-mail": "^1.1.2",
        "@koishijs/plugin-adapter-telegram": "^3.7.15",
        "@koishijs/plugin-admin": "^1.4.0",
        "@koishijs/plugin-auth": "^4.1.0",
        "@koishijs/plugin-bind": "^1.4.2",
        "@koishijs/plugin-commands": "^3.2.2",
        "@koishijs/plugin-config": "^2.3.0",
        "@koishijs/plugin-console": "^5.13.1",
        "@koishijs/plugin-database-mysql": "5.4.8",
        "@koishijs/plugin-dataview": "^2.3.1",
        "@koishijs/plugin-explorer": "^1.4.5",
        "@koishijs/plugin-hmr": "^1.2.1",
        "@koishijs/plugin-insight": "^3.4.1",
        "@koishijs/plugin-locales": "^2.4.0",
        "@koishijs/plugin-logger": "^2.3.2",
        "@koishijs/plugin-market": "2.2.10",
        "@koishijs/plugin-sandbox": "3.1.10",
        "@koishijs/plugin-status": "^7.1.3",
        "koishi": "^4.14.1",
        "koishi-plugin-assets-local": "^3.1.0",
        "koishi-plugin-message-logger": "2.0.0",
        "@koishijs/client": "^5.13.1",
        "@koishijs/scripts": "^4.3.0",

nodejs: v18.14.1 platform: windows

Additional context

No response

shigma commented 1 year ago

多例问题。请自行修复 node_modules。