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: 未能成功安装插件的修复完成后仍然无法加载,必须手动重启 #273

Open
shigma opened this issue Dec 20, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed plugin: config plugin: market

Comments

@shigma
Copy link
Member

shigma commented Dec 20, 2023

复现流程:

  1. 创建一个全新实例
  2. 前往插件市场并安装 echo 插件(此时未能复现此问题)
  3. 停止实例运行
  4. 打开 package.json,删除 @koishijs/plugin-echo 这一行
  5. yarn 更新依赖
  6. 打开 package.json,重新写上刚刚删除的那一行
  7. 运行实例并打开 echo 插件配置界面
  8. 根据提示点击修复依赖
  9. 观察到实例重启,此时日志中出现报错 Cannot find module……

补充:如果去掉「重新写上刚刚删除的那一行」这一步,一切正常,但很难理解这一步的影响。

@shigma
Copy link
Member Author

shigma commented Dec 20, 2023

补充一些信息:报错信息来自于 require.resolve(name),然而:

  • 与此同时 require(name + 'package.json') 正常运行给出结果,说明 node 能解析这个路径相关的文件
  • 与此同时其他 node 经常能够正常 require.resolve(name),说明这里的报错可能是某种缓存的行为
  • 刷新页面、重启 config 和 market 插件均无法解决此问题,说明这个问题可能与当前 node 运行时有关,与其他 node 运行时和插件的运行状态无关

目前没有什么思路。先标一个 help wanted。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed plugin: config plugin: market
Projects
None yet
Development

No branches or pull requests

1 participant