jackMort / jackMort/ChatGPT.nvim

Error: Can't open ChatGPT

Open
#465 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
4k
Forks
317
PR merge metrics
No merged PRs in 30d

Description

when typing `:ChatGPT` then pressing enter, it gives the following error:
```
Error executing Lua callback: ...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:52: attempt to index field 'popup_layout' (a nil value)
stack traceback:
...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:52: in function 'init'
...packer/start/ChatGPT.nvim/lua/chatgpt/common/classes.lua:88: in function 'new'
...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/init.lua:13: in function 'open_chat'
...nvim/site/pack/packer/start/ChatGPT.nvim/lua/chatgpt.lua:34: in function 'openChat'
...m/site/pack/packer/start/ChatGPT.nvim/plugin/chatgpt.lua:2: in function <...m/site/pack/packer/start/ChatGPT.nvim/plugin/chatgpt.lua:1>
```

this is my current configuration with packer:
```
local home = vim.fn.expand("$HOME")
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup({
api_key_cmd = "echo 'my_key'"
})
end,
requires = {
"MunifTanjim/nui.nvim",
"folke/trouble.nvim",
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
}
})

if packer_bootstrap then
require('packer').sync()
end
end)

EOF
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure by running :ChatGPT with the shown packer configuration. Start at lua/chatgpt/flows/chat/base.lua:52 and trace how popup_layout is initialized through lua/chatgpt/flows/chat/init.lua and lua/chatgpt.lua. Done means the command opens without the reported nil-field error and the relevant configuration path is covered by a regression test, if the project has one.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.