Checklist
Neovim version (nvim -v)
NVIM v0.12.2
Operating system/version
Linux
Terminal/GUI
bash
Describe the bug
When using the mcphub.nvim plugin from astrocommunity together with codecompanion.nvim, a "bad argument #1 to 'pairs' (table expected, got nil)" error occurs when starting Neovim. The error occurs when the mcphub extension attempts to register variables (make_vars = true) with codecompanion.
Steps to Reproduce
- Install the mcphub.nvim and codecompanion.nvim plugins via astrocommunity.
- Restart NeoVim
- open any file
- see error in bottom panel
Expected behavior
vim.schedule callback: ...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:20: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:20: in function 'register'
...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:92: in function ''
vim/_core/editor.lua: in function <vim/_core/editor.lua:0>
Screenshots
No response
Additional Context
No response
Minimal configuration
-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-- install plugins
local plugins = {
{ "AstroNvim/AstroNvim", import = "astronvim.plugins" },
{ "AstroNvim/astrocommunity" },
-- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- add anything else here (autocommands, vim.filetype, etc.)
Checklist
repro.luaprovided belowNeovim version (nvim -v)
NVIM v0.12.2
Operating system/version
Linux
Terminal/GUI
bash
Describe the bug
When using the mcphub.nvim plugin from astrocommunity together with codecompanion.nvim, a "bad argument #1 to 'pairs' (table expected, got nil)" error occurs when starting Neovim. The error occurs when the mcphub extension attempts to register variables (make_vars = true) with codecompanion.
Steps to Reproduce
Expected behavior
vim.schedule callback: ...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:20: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:20: in function 'register'
...b.nvim/lua/mcphub/extensions/codecompanion/variables.lua:92: in function ''
vim/_core/editor.lua: in function <vim/_core/editor.lua:0>
Screenshots
No response
Additional Context
No response
Minimal configuration