When lazy-loading copilot.lua with following configuration
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
event = "BufReadPost",
-- commit = "784f4eb", -- good
commit = "2cd99fb", -- bad
opts = {},
},
}
Then when the plugin is installed via lazy.nvim plugin manager, an error occurs [ERROR]: client is not initialized yet, which is caused by the part in the aforementioned config build = ":Copilot auth". The solution is to not include that. It seems that Copilot commands throw this error when the LSP server is not initialized, because I tried the same without the build part and upon installation, when I open Neovim and the dashboard appears, if I run manually :Copilot auth it also throws the error on the dashboard. A buffer has to be opened, so that the plugin loads first and LSP server attaches and then be able to run Copilot commands.
As you can see I have 2 commits in the above configuration, 2cd99fb which throws this error and 784f4eb which doesn't throw the error. So, this occurs because of some change in 2cd99fb commit.
Not sure if this is a bug per se, maybe it's intended behavior after commit 2cd99fb. I would just like some feedback regarding if this is a bug or not. I'm using LazyVim and build = ":Copilot auth" is present in the default configuration, which causes the error. But I was also able to repro the same error with just a plain lazy.nvim config, which contains the aforementioned plugin spec for Copilot.
When lazy-loading
copilot.luawith following configurationThen when the plugin is installed via
lazy.nvimplugin manager, an error occurs[ERROR]: client is not initialized yet, which is caused by the part in the aforementioned configbuild = ":Copilot auth". The solution is to not include that. It seems that Copilot commands throw this error when the LSP server is not initialized, because I tried the same without thebuildpart and upon installation, when I open Neovim and the dashboard appears, if I run manually:Copilot authit also throws the error on the dashboard. A buffer has to be opened, so that the plugin loads first and LSP server attaches and then be able to run Copilot commands.As you can see I have 2 commits in the above configuration,
2cd99fbwhich throws this error and784f4ebwhich doesn't throw the error. So, this occurs because of some change in2cd99fbcommit.Not sure if this is a bug per se, maybe it's intended behavior after commit
2cd99fb. I would just like some feedback regarding if this is a bug or not. I'm using LazyVim andbuild = ":Copilot auth"is present in the default configuration, which causes the error. But I was also able to repro the same error with just a plainlazy.nvimconfig, which contains the aforementioned plugin spec for Copilot.