Closed WyInnovate closed 1 year ago
重新全局安装下,升级到最新的包 v1.1.1,昨天有个版本依赖有问题,如果还是同样报错请留言 😝
@canisminor1990
笔记本电脑、系统:win11专业版22621.1702、openai key已设置、使用默认openai地址、git仓库为本地服务器自建gitlab
npm install -g @lobehub/commit-cli
D:\Git项目\lobe>lobe
Generating...
Error: Invalid environment; fetch is not defined at new ChatGPTAPI (file:///C:/Users//AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/chatgpt/build/index.js:174:13) at M (file:///C:/Users//AppData/Roaming/npm/node_modules/@lobehub/commit-cli/dist/cli.js:3:862) at file:///C:/Users//AppData/Roaming/npm/node_modules/@lobehub/commit-cli/dist/cli.js:3:2438 at commitHookEffectListMount (C:\Users\\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:14778:26) at commitPassiveMountOnFiber (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:16609:11) at commitPassiveMountEffects_complete (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:16569:9) at commitPassiveMountEffects_begin (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:16556:7) at commitPassiveMountEffects (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:16544:3) at flushPassiveEffectsImpl (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:19182:3) at flushPassiveEffects (C:\Users*\AppData\Roaming\npm\node_modules\@lobehub\commit-cli\node_modules\react-reconciler\cjs\react-reconciler.development.js:19127:14)
# 其他问题
1. 选择 📝 docs - Add or update README and documentation
2. 输入all
3. 输入测试
4. 输入No
5. 报错,报错内容:
D:\Git项目\lobe>lobe ⠋ Committing... [main 9479ffd] 📝 docs(all): 测试 [#No] 1 file changed, 0 insertions(+), 0 deletions(-)
ERROR The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received undefined
node:internal/errors:387:5
6. 查看日志,已提交到本地,未推送到仓库
应该是 node 18 以下 fetch polyfill 问题,我把依赖添加上了,你可以更新下或者升级 node 版本试试
应该是 node 18 以下 fetch polyfill 问题,我把依赖添加上了,你可以更新下或者升级 node 版本试试
已知问题情况
问题1:Error: Invalid environment; fetch is not defined
- 更新lobe-commit,问题未解决
- 升级node 版本到18.16.0,问题解决
问题2:ERROR The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received undefined
- 更新lobe-commit,问题解决
新增问题
- 更新lobe-commit后,选择 📝 docs - Add or update README and documentation,输入信息时输入英文非常卡顿、慢,并且如果删除输入的内容过快(比如按住Backspace键或者快速多次点击Backspace键),会出现多余字符h同时删除非常卡顿、慢
- 不输入OpenAI 的转发地址的话,即使笔记本电脑使用了代理软件比如v2rayN设置好api.openai.com走代理(非全局代理),也不会走代理,然后报错,报错内容应该就是指连接不上接口,报错内容如下:
TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11457:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.then.promptTokens (file:///C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/chatgpt/build/index.js:298:25)
- 使用lobe-coomit --init后,使用Use AI Commit - generate commit message by ChatGPT,会滚动出现无数的Generating,然后生成提交信息后也会重影,选择Use this message后出现hint: Waiting for your editor to close the file...,然后会弹出vscode编辑界面(这个弹出vscode编辑界面是基于默认应用吗?我想大概是,啊跑题了),图片如下所示:
- 如果 [3] 无法解决,我可以看看渲染性能优化的问题
- termianl 不会跟随系统代理,要单独设置,除非前置如路由侧就代理了
- windows 下如果是用原装 terminal 最好使用 windows terminal + powershell 7 内核,渲染比较好,不会出现这种重影换行
windows 下:PowerShell 7.4.0-preview.3、PowerShell 7.3.4
使用 windows terminal + powershell 7 内核 7.4.0-preview.3和PowerShell 7.3.4:
https://github.com/canisminor1990/lobe-commit/assets/17870709/08da4374-7415-4d6c-bf14-9a2d5e82916a
@s544838371 增加了防抖,之前确实在长按退格时会出现卡顿,但还是无法复现重影
@canisminor1990
https://github.com/lobehub/commit-cli/assets/40713819/077eb6d6-e5c5-4119-b317-0fbe29cd8308
🧐 问题描述 | Proposed Solution
求助,遇到如下报错
📝 补充信息 | Additional Information
没查到怎么解决这个问题,希望大佬不要打我emmm