jackMort / ChatGPT.nvim

ChatGPT Neovim Plugin: Effortless Natural Language Generation with OpenAI's ChatGPT API
Apache License 2.0
3.71k stars 310 forks source link

Error: Can't open ChatGPT #465

Open revoltez opened 2 weeks ago

revoltez commented 2 weeks ago

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
Malikazz commented 1 week ago

Same issue for me fresh install today running in Windows 11, Terminal

use({
            "jackMort/ChatGPT.nvim",
            config = function()
                require("chatgpt").setup()
            end,
            requires = {
                "MunifTanjim/nui.nvim",
                "nvim-lua/plenary.nvim",
                "folke/trouble.nvim",
                "nvim-telescope/telescope.nvim"
            }
        })