Skip to content

module 'vectorcode.integrations' not found #101

Closed

Description

@bbli

Hi there I followed the instructions on the wiki to integrate VectorCode into code companion. I followed the instructions to modify the opts for code companion like so:

    opts = {
      strategies = {
        chat = {
          adaptor = "copilot",
          tools = {
            vectorcode = {
              description = "Run VectorCode to retrieve the project context.",
              callback = function()
                return require("vectorcode.integrations.codecompanion").chat.make_tool()
              end,
            },
          },
          slash_commands = {
            -- add the vectorcode command here.
            codebase = require("vectorcode.integrations").codecompanion.chat.make_slash_command(),
          },
        },
        inline = {
          adaptor = "copilot",
        },
        cmd = {
          adaptor = "copilot",
        },
      },
    },

but I got the following error:

/Users/beli/.config/nvim/lua/plugins/code_companion.lua:41: module 'vectorcode.integrations' not found:
	no field package.preload['vectorcode.integrations']
cache_loader: module vectorcode.integrations not found
cache_loader_lib: module vectorcode.integrations not found
	no file './vectorcode/integrations.lua'
	no file '/opt/homebrew/share/luajit-2.1/vectorcode/integrations.lua'
	no file '/usr/local/share/lua/5.1/vectorcode/integrations.lua'
	no file '/usr/local/share/lua/5.1/vectorcode/integrations/init.lua'
	no file '/opt/homebrew/share/lua/5.1/vectorcode/integrations.lua'
	no file '/opt/homebrew/share/lua/5.1/vectorcode/integrations/init.lua'
	no file './vectorcode/integrations.so'
	no file '/usr/local/lib/lua/5.1/vectorcode/integrations.so'
	no file '/opt/homebrew/lib/lua/5.1/vectorcode/integrations.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file './vectorcode.so'
	no file '/usr/local/lib/lua/5.1/vectorcode.so'
	no file '/opt/homebrew/lib/lua/5.1/vectorcode.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - ~/.config/nvim/lua/plugins/code_companion.lua:41 _in_ **load**
  - ~/.config/nvim/lua/config/lazy.lua:17
  - .config/nvim/init.lua:2

Activity

  1. Davidyz commented on Apr 30, 2025

    @Davidyz
    Owner

    Hi, is your opts table wrapped in a function like this? If not, this will make the require('vectorcode.integrations') being loaded before vectorcode is loaded.

    BTW codecompanion released a new extension API which makes this a lot easier. I'm working on migrating to this (the current approach will still work, but with the extension API it'll be easier to set up tools/slash commands).

  2. Repository owner locked and limited conversation to collaborators on Apr 30, 2025
  3. converted this issue into a discussion #102 on Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions