yetone / avante.nvim

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

bug: Make sure to build avante (missing avante_templates) #561

Closed mascanho closed 1 month ago

mascanho commented 1 month ago

Describe the bug

E5108: Error executing lua: ..._1/.local/share/nvim/lazy/avante.nvim/lua/avante/llm.lua:60: Make sure to build avante (missing avante_templates) stack traceback: [C]: in function 'error' ...1/.local/share/nvim/lazy/avante.nvim/lua/avante/path.lua:75: in function 'get' ..._1/.local/share/nvim/lazy/avante.nvim/lua/avante/llm.lua:60: in function 'stream' ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1273: in function 'handle_submit' ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1327: in function <...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1317>

To reproduce

return { "yetone/avante.nvim",

event = "VeryLazy",
lazy = true,
opts = {
    -- add any opts here
    default = "gemini",
    provider = "gemini",
},
keys = {
    {
        "<leader>aa",
        function()
            require("avante.api").ask()
        end,
        desc = "avante: ask",
        mode = { "n", "v" },
    },
    {
        "<leader>ar",
        function()
            require("avante.api").refresh()
        end,
        desc = "avante: refresh",
    },
    {
        "<leader>ae",
        function()
            require("avante.api").edit()
        end,
        desc = "avante: edit",
        mode = "v",
    },
},
dependencies = {
    "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 setup it properly if you have lazy=true
        "MeanderingProgrammer/render-markdown.nvim",
        opts = {
            file_types = { "markdown", "Avante" },
        },
        ft = { "markdown", "Avante" },
    },
},

}

Expected behavior

Once the error goes away it says generating response but nothing happens. I close and open avante and the same happens. I think it happened after an update.

Environment

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1720049189 Run "nvim -V1 -v" for more info

pandikaadi commented 1 month ago

I've got the same issue after updating too

aarnphm commented 1 month ago

Hi there, in the readme we don't set lazy=true. Make sure to setup accordingly.

Closed due to not following instruction.

Ethnical commented 1 month ago

Humm, got the same config as the readme but this worked for me: https://github.com/yetone/avante.nvim/issues/544#issuecomment-2334374237

mascanho commented 1 month ago

Fantastic, this has fixed it. thank you