Giter Club home page Giter Club logo

Comments (8)

canisminor1990 avatar canisminor1990 commented on June 16, 2024

重新全局安装下,升级到最新的包 v1.1.1,昨天有个版本依赖有问题,如果还是同样报错请留言 😝

from lobe-cli-toolbox.

WyInnovate avatar WyInnovate commented on June 16, 2024

@canisminor1990

环境说明

笔记本电脑、系统:win11专业版22621.1702、openai key已设置、使用默认openai地址、git仓库为本地服务器自建gitlab

操作说明

重新安装

npm install -g @lobehub/commit-cli

使用

  1. 在D:\Git项目\lobe目录cmd
  2. git add .
  3. lobe
  4. 选择Use AI Commit
  5. 报错,报错内容如下:
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

 - NodeError (node:internal/errors:387:5)
 - _write (node:internal/streams/writable:314:13)
 - WriteStream.Writable.write (node:internal/streams/writable:336:10)
 - Ink.writeToStdout (file:///C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/ink/build/ink.js:241:29)
 -  (file:///C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/dist/cli.js:3:2105)
 - commitHookEffectListMount (C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/react-reconciler/cjs/react-reconciler.development.js:14778:26)
 - commitPassiveMountOnFiber (C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/react-reconciler/cjs/react-reconciler.development.js:16609:11)
 - commitPassiveMountEffects_complete (C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/react-reconciler/cjs/react-reconciler.development.js:16569:9)
 - commitPassiveMountEffects_begin (C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/react-reconciler/cjs/react-reconciler.development.js:16556:7)
 - commitPassiveMountEffects (C:/Users/***/AppData/Roaming/npm/node_modules/@lobehub/commit-cli/node_modules/react-reconciler/cjs/react-reconciler.development.js:16544:3)
  1. 查看日志,已提交到本地,未推送到仓库

from lobe-cli-toolbox.

canisminor1990 avatar canisminor1990 commented on June 16, 2024

应该是 node 18 以下 fetch polyfill 问题,我把依赖添加上了,你可以更新下或者升级 node 版本试试

from lobe-cli-toolbox.

WyInnovate avatar WyInnovate commented on June 16, 2024

应该是 node 18 以下 fetch polyfill 问题,我把依赖添加上了,你可以更新下或者升级 node 版本试试

已知问题情况

问题1:Error: Invalid environment; fetch is not defined

  1. 更新lobe-commit,问题未解决
  2. 升级node 版本到18.16.0,问题解决

问题2:ERROR The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received undefined

  1. 更新lobe-commit,问题解决

新增问题

  1. 更新lobe-commit后,选择 📝 docs - Add or update README and documentation,输入信息时输入英文非常卡顿、慢,并且如果删除输入的内容过快(比如按住Backspace键或者快速多次点击Backspace键),会出现多余字符h同时删除非常卡顿、慢
  2. 不输入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)
  1. 使用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编辑界面是基于默认应用吗?我想大概是,啊跑题了),图片如下所示:
    1
    2
    3

from lobe-cli-toolbox.

canisminor1990 avatar canisminor1990 commented on June 16, 2024
  1. 如果 [3] 无法解决,我可以看看渲染性能优化的问题
  2. termianl 不会跟随系统代理,要单独设置,除非前置如路由侧就代理了
  3. windows 下如果是用原装 terminal 最好使用 windows terminal + powershell 7 内核,渲染比较好,不会出现这种重影换行

from lobe-cli-toolbox.

WyInnovate avatar WyInnovate commented on June 16, 2024
  1. 如果 [3] 无法解决,我可以看看渲染性能优化的问题
  2. termianl 不会跟随系统代理,要单独设置,除非前置如路由侧就代理了
  3. 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:

  1. 渲染性能无变化仍然卡顿、慢、删除时会出现字母h2
  2. 重影现象仍然存在,如下图所示
    1

from lobe-cli-toolbox.

canisminor1990 avatar canisminor1990 commented on June 16, 2024
2023-05-19.214037.mp4

@s544838371 增加了防抖,之前确实在长按退格时会出现卡顿,但还是无法复现重影

from lobe-cli-toolbox.

WyInnovate avatar WyInnovate commented on June 16, 2024

@canisminor1990

测试情况说明

2023.5.30更新后已知问题

  1. 重影问题,重影出现的前提是使用hook即,lobe -i,然后git commit的时候就会出现

录屏

20230530_172429.mp4

from lobe-cli-toolbox.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.