yetone / avante.nvim

Use your Neovim like using Cursor AI IDE!
Apache License 2.0
6.52k stars 238 forks source link

bug: `Failed to load avante_repo_map` #635

Closed DevonPeroutky closed 1 month ago

DevonPeroutky commented 1 month ago

Describe the bug

I just did a fresh install of Avante using LazyVim, however when I open up neovim I get the following error message about Failed to load avante_repo_map

Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/avante.nvim/lua/avante/repo_map.lua:19: Failed to load avante_repo_map
stack traceback:
        [C]: in function 'error'
        ...ocal/share/nvim/lazy/avante.nvim/lua/avante/repo_map.lua:19: in function ''
        vim/_editor.lua: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

My Environment:

To reproduce

This is the default config I copy and pasted into .config/nvim/lua/plugins/avante.lua

return {
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    --- The below dependencies are optional,
    "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
    "zbirenbaum/copilot.lua", -- for providers='copilot'
    {
      -- support for image pasting
      "HakonHarnes/img-clip.nvim",
      event = "VeryLazy",
      opts = {
        -- recommended settings
        default = {
          embed_image_as_base64 = false,
          prompt_for_file_name = false,
          drag_and_drop = {
            insert_mode = true,
          },
          -- required for Windows users
          use_absolute_path = true,
        },
      },
    },
    {
      -- Make sure to set this up properly if you have lazy=true
      "MeanderingProgrammer/render-markdown.nvim",
      opts = {
        file_types = { "markdown", "Avante" },
      },
      ft = { "markdown", "Avante" },
    },
  },
}

Expected behavior

Opening neovim with no error messages

Environment

My Environment:

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    -- add any other plugins here
  },
})
WayenVan commented 1 month ago

same here, this problem only occur on MacBook, I tested in Linux and Winodws, they are all running well

yetone commented 1 month ago

You can try this solution: https://github.com/yetone/avante.nvim/issues/612#issuecomment-2375729928

yetone commented 1 month ago

The final solution is as follows: https://github.com/yetone/avante.nvim/issues/612#issuecomment-2375810514