ChatGPT.nvim
ChatGPT.nvim copied to clipboard
ChatGPT plugin error luca callback error
Hello,
Did anyone get this error?
Error executing Lua callback: vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/shared.lua: in function 'tbl_deep_extend'
.../pack/packer/start/ChatGPT.nvim/lua/chatgpt/settings.lua:70: in function 'get_settings_panel'
...ack/packer/start/ChatGPT.nvim/lua/chatgpt/code_edits.lua:83: in function 'edit_with_instructions'
...nvim/site/pack/packer/start/ChatGPT.nvim/lua/chatgpt.lua:33: in function 'edit_with_instructions'
...m/site/pack/packer/start/ChatGPT.nvim/plugin/chatgpt.lua:10: in function <...m/site/pack/packer/start/ChatGPT.nvim/plugin/chatgpt.lua:9>
Thank you

I'm getting an error as well but not the same one
Error executing Lua callback: ...k/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:2: loop or previous error loading module 'chatgpt'
stack traceback:
[C]: in function 'require'
...k/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:2: in function <...k/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:1>
Press ENTER or type command to continue
This is occurring in the plugins/chatgpt.lua file when trying to require('chatgpt').openChat().
This require is failing, any idea how to fix this? @jackMort
Will be very helpful if you can take a look
I have this issue also. @mPanasiewicz did you fix it somehow? I have no custom config, and have only copy pasted the packer snippet to install and then compile.
Also getting this issue.
+1
Please share your setup, i need more details to be able to help
my setup using Lazy:
return {
"jackMort/ChatGPT.nvim",
setup = function()
require("chatpgt").setup({})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
}
Error when running :ChatGPT
Error executing Lua callback: vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/shared.lua: in function 'tbl_deep_extend'
...al/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt/settings.lua:70: in function 'get_settings_panel'
...ocal/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt/module.lua:67: in function 'open_chat'
...ocal/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt/module.lua:280: in function 'openChat'
...icky/.local/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt.lua:25: in function 'openChat'
...y/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:2: in function <...y/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:1>
This is on Neovim nightly, specifically:
NVIM v0.9.0-dev-1318+g53f36806f Build type: RelWithDebInfo LuaJIT 2.1.0-beta3
Error when running :ChatGPTCompleteCode:
Error executing Lua callback: vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/shared.lua: in function 'tbl_extend'
.../.local/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt/api.lua:18: in function 'completions'
...ChatGPT.nvim/lua/chatgpt/flows/code_completions/init.lua:54: in function 'complete_code'
...y/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:40: in function <...y/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:39>
Thanks @NickyTope , I'm using packer and tested it only for it, but going to do the same with lazy to make sure it works
Please share your setup, i need more details to be able to help
I am using packer with the default setup.
Please share your setup, i need more details to be able to help
I am also using packer with the default setup. Nvim 0.8.2.
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup({
-- optional configuration
})
end,
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
})
oh wait, when i remove the comment, and the empty table, it works.
Config should be:
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup()
end,
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
})
I updated the readme to include instructions for Lazy as well, please make sure you have OPENAI_API_KEY set properly and it should works, I've tested it on multiple setups