Skip to content

[BUG] Error executing vim.schedule lua callback: "src must be a table or function" in lua/vectorcode/init.lua:194 #291

@minusfive

Description

@minusfive

Describe the bug

VectorCode nvim plugin throws errors on start. Seems to continue to work OK, but the errors still show up on every start. After start errors don't appear again, though.

Error executing vim.schedule lua callback: ...Cellar/neovim/0.11.4/share/nvim/runtime/lua/vim/iter.lua:1067: src must be a table or function
stack traceback:
	[C]: in function 'error'
	...Cellar/neovim/0.11.4/share/nvim/runtime/lua/vim/iter.lua:1067: in function 'iter'
	...local/share/nvim/lazy/VectorCode/lua/vectorcode/init.lua:194: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

To Reproduce

Steps to reproduce the behavior:

  1. install VectorCode and nvim plugin following Readme
  2. vectorcode init in a project
  3. open nvim
  4. run :VectorCode <anything> in nvim

Expected behavior

No errors

VectorCode Configuration

Note

I don't use a config.json, neither globally nor in the project. I rely on defaults. Not sure if that has anything to do with it, but figured I'd mention it.

For issues with the Neovim plugin, please also attach your setup options:

{
    "Davidyz/VectorCode",
    version = "*", -- optional, depending on whether you're on nightly or release
    build = "uv tool upgrade vectorcode", -- optional but recommended. This keeps your CLI up-to-date.
    dependencies = {
      "nvim-lua/plenary.nvim",
      {
        "neovim/nvim-lspconfig",
        ---@class PluginLspOpts
        opts = {
          servers = { vectorcode_server = {} },
        },
      },
    },
    cmd = { "VectorCode" },
    ---@module "vectorcode"
    ---@type VectorCode.Opts|{}
    opts = {
      async_backend = "lsp",
      on_setup = {
        update = true, -- whether to update the CLI on setup
        lsp = true, -- whether to setup the LSP server
      },
    },
    keys = {
      {
        "<leader>au",
        function() return require("vectorcode").update() end,
        desc = "Update (VectorCode)",
        mode = { "n", "v" },
      },
    },
  }

If it only occurs when you use VectorCode with a particular plugin, please
attach the relevant config here:

Platform information:

  • If the issue is about the neovim plugin, attach the neovim version you're using:
0.11.4

System Information:

For Mac users, please also mention whether you're using intel or apple silicon devices.

  • OS: MacOS 15.6.1, Apple Silicon (M3)

Additional context
Add any other context about the problem here. Please attach
CLI logs
or
nvim plugin logs
if applicable.

[INFO  Mon Sep 22 09:57:54 2025] /Users/<user>/.local/share/nvim/lazy/VectorCode/lua/vectorcode/config.lua:123: Received setup opts:
 {
  async_backend = "lsp",
  on_setup = {
    lsp = true,
    update = true
  }
}
[DEBUG Mon Sep 22 09:57:54 2025] /Users/<user>/.local/share/nvim/lazy/VectorCode/lua/vectorcode/jobrunner/cmd.lua:14: cmd jobrunner for buffer 0 args: { "check", "config" }
[DEBUG Mon Sep 22 09:57:54 2025] /Users/<user>/.local/share/nvim/lazy/VectorCode/lua/vectorcode/config.lua:51: Using vim.lsp.config.vectorcode_server for LSP config:
 {
  capabilities = {
    textDocument = {
      completion = {
        completionItem = {
          commitCharactersSupport = false,
          deprecatedSupport = true,
          documentationFormat = { "markdown", "plaintext" },
          insertReplaceSupport = true,
          insertTextModeSupport = {
            valueSet = { 1 }
          },
          labelDetailsSupport = true,
          preselectSupport = false,
          resolveSupport = {
            properties = { "documentation", "detail", "additionalTextEdits", "command", "data" }
          },
          snippetSupport = true,
          tagSupport = {
            valueSet = { 1 }
          }
        },
        completionList = {
          itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" }
        },
        contextSupport = true,
        insertTextMode = 1
      }
    },
    workspace = {
      fileOperations = {
        didRename = true,
        willRename = true
      }
    }
  },
  cmd = { "vectorcode-server" },
  name = "vectorcode_server",
  root_dir = "/Users/<user>/dev/personal/dot",
  root_markers = { ".vectorcode", ".git" },
  settings = {}
}
[INFO  Mon Sep 22 09:57:54 2025] /Users/<user>/.local/share/nvim/lazy/VectorCode/lua/vectorcode/config.lua:143: Finished processing opts:
 {
  async_backend = "lsp",
  async_opts = {
    debounce = 10,
    events = { "BufWritePost", "InsertEnter", "BufReadPost" },
    exclude_this = true,
    n_query = 1,
    notify = true,
    query_cb = <function 1>,
    run_on_register = false,
    single_job = false,
    timeout_ms = 5000
  },
  cli_cmds = {
    vectorcode = "vectorcode"
  },
  exclude_this = true,
  n_query = 1,
  notify = true,
  on_setup = {
    lsp = true,
    update = true
  },
  sync_log_env_var = false,
  timeout_ms = 5000
}
[DEBUG Mon Sep 22 09:57:54 2025] /Users/<user>/.local/share/nvim/lazy/VectorCode/lua/vectorcode/config.lua:155: Using LSP backend for cacher.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions