ChatGPT.nvim icon indicating copy to clipboard operation
ChatGPT.nvim copied to clipboard

Vim:E6100: "state" is not a valid stdpath

Open Aguilar-Cabello opened this issue 3 years ago • 4 comments

Hi, first of all, this is the most exiting pluging I've ever seen, thank you for your work.

I get an error executing the command :ChatGPT

Error executing Lua callback: Vim:E6100: "state" is not a valid stdpath stack traceback: [C]: in function 'stdpath' .../plugged/ChatGPT.nvim/lua/chatgpt/flows/chat/session.lua:111: in function 'get_dir' .../plugged/ChatGPT.nvim/lua/chatgpt/flows/chat/session.lua:119: in function 'list_sessions' ...plugged/ChatGPT.nvim/lua/chatgpt/flows/chat/sessions.lua:95: in function 'get_panel' ....config/nvim/plugged/ChatGPT.nvim/lua/chatgpt/module.lua:89: in function 'open_chat' ....config/nvim/plugged/ChatGPT.nvim/lua/chatgpt/module.lua:208: in function 'openChat' .../jorge/.config/nvim/plugged/ChatGPT.nvim/lua/chatgpt.lua:24: in function 'openChat' ...rge/.config/nvim/plugged/ChatGPT.nvim/plugin/chatgpt.lua:2: in function <...rge/.config/nvim/plugged/ChatGPT.nvim/plugin/chatgpt.lua:1>

Same error occurs using :ChatGPTActAs once I select an option

ChatGPTEditWithInstructions and ChatGPTRunCustomCodeAction are working fine.

I installed ChatGPT.nvim using plug following issue #46 instructions.

Aguilar-Cabello avatar Jan 18 '23 16:01 Aguilar-Cabello

What operating system are you using?

jackMort avatar Jan 19 '23 09:01 jackMort

Ubuntu 22.04 lts

Aguilar-Cabello avatar Jan 19 '23 14:01 Aguilar-Cabello

@Aguilar-Cabello I had the same issue. It turns out I had neovim version 0.7.0, which throws an error when calling stdpath('state'). I've updated to 0.8.0 and the plugin works fine now

tvergara avatar Jan 25 '23 04:01 tvergara

Thank you @tvergara It kind of worked, I have updated to neovim 0.8.0. Now The commands ChatGPT, ChatGPTActAs and ChatGPTEditWithInstructions works great.

ChatGPTRunCustomCodeAction was previously working, and now it is broken with the following error once I use any prompt:

Error executing vim.schedule lua callback: .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/base.lua:44: attempt to index a nil value

stack traceback:
        .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/base.lua:44: in function 'get_visual_selection'
        .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/base.lua:66: in function 'mark_selection_with_signs'
        .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/base.lua:101: in function 'set_loading'
        ...tGPT.nvim/lua/chatgpt/flows/actions/completions/init.lua:64: in function <...tGPT.nvim/lua/chatgpt/flows/actions/completions/init.lua:63>

ChatGPTRun is also not working with the following error:

Error executing Lua callback: .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/init.lua:60: attempt to index local 'item' (a nil value)                                                                
stack traceback:
        .../plugged/ChatGPT.nvim/lua/chatgpt/flows/actions/init.lua:60: in function 'run_action'
        .../jorge/.config/nvim/plugged/ChatGPT.nvim/lua/chatgpt.lua:36: in function 'run_action'
        ...rge/.config/nvim/plugged/ChatGPT.nvim/plugin/chatgpt.lua:14: in function <...rge/.config/nvim/plugged/ChatGPT.nvim/plugin/chatgpt.lua:13>

Maybe this should be in a new issue now.

Aguilar-Cabello avatar Jan 28 '23 16:01 Aguilar-Cabello