Closed twilwa closed 1 month ago
I have the same issue. I resolved it by running:
:AvanteBuild
I'm not sure if this can resolved if we replace "make" with "AvanteBuild" as well
cc: @twilwa
:AvanteBuild doesn't provide any terminal feedback when I just run it with neovim open and the error persists, did you modify the default config at all?
For me the issue was in a wrong architecture (I use x86), so I had to :AvanteBuild source=true
But it also failed (silently)
After some digging I figured the problem was with outdated version of rustc
After upgrading rust :AvanteBuild source=true
succeeded and the issue is now resolved for me
@twilwa you can also verify outside of neovim, by checking out https://github.com/yetone/avante.nvim/ into a separate directory and then in that directory, type:
make BUILD_FROM_SOURCE=true
If you don't have the correct versions of cargo
and rustc
, then the compilation will fail, and it might be easier to see why.
If you run make BUILD_FROM_SOURCE=true
and then start neovim, after about one second, neovim exits without outputting any error messages.
@nekowasabi on your computer, what directory were you in when you ran make BUILD_FROM_SOURCE=true
. Did this command succeed? What version of cargo and rustc do you have?
@rodrigc The environment is as follows
@nekowasabi That version of cargo and rustc look good. If you ran the make
in the directory /Users/nekowasabi/.config/nvim/plugged/avante.nvim
, and the command worked, that should be enough. Are you sure cargo built something? If it did, there is something else wrong.
Sorry, the specific reason was not found because theoretically everything should work fine if you have build = "make"
in your lazy config. I also couldn't reproduce it locally using Lazy.nvim, but you can manually fix this issue with the following steps:
(Important) Update avante.nvim to the latest version
Go to the location of avante.nvim: a. lazy.nvim
cd ~/.local/share/nvim/lazy/avante.nvim
b. packer.nvim
cd ~/.local/share/nvim/site/pack/packer/start/avante.nvim
c. vim-plug
cd ~/.config/nvim/plugged/avante.nvim
d. Others follow similarly
Manually execute the make
command:
make
Check if the make
command successfully downloaded all dependencies:
ls ./build/
Normally, there should be several files in the ./build/
directory:
ls ./build/
avante_repo_map.dylib avante_templates.dylib avante_tokenizers.dylib
@nekowasabi No worries, thanks for your detailed analysis. Glad you got it to work.
The make
step can fail for various reasons, and currently the plugin does not show the output of the build
step, so it can be difficult to figure out what is going on.
I ran into these two problems:
cargo
and rustc
were not in my PATH, so the build step never workedcargo
in my PATH, but it was cargo/rustc
version 1.75, which was too old, and the compilation failedIf avante placed the output of the build command in a popup window, that might help people figure things out.
What operating system are you? Because I suspect that the previously precompiled artifacts did not include darwin-x86_64, which caused this issue. I just fixed it: https://github.com/yetone/avante.nvim/pull/637
My system is:
sw_vers
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G93
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1720049189
Yes, I am on darwin-x86_64 (Intel i9), so looks like https://github.com/yetone/avante.nvim/issues/637 addresses one issue I had.
My advice would be to put the make
command in a popup window, so that errors can be seen more easily, but that is not a big deal.
I have started using avante.nvim on my project, and it is amazing!! Thanks for it, @yetone !
I feel that this issue has been resolved. If the same problem occurs again, I will reopen this issue.
@rodrigc @yetone It worked. Thank you!!
Maybe I'm doing something wrong, but although everything seems to be executed smoothly:
LUA_VERSION=luajit bash ./build.sh
+ mkdir -p /Users/daiego/.vim/plugged/avante.nvim/build
+ curl -L https://github.com/yetone/avante.nvim/releases/download/v0.0.8/avante_lib-darwin-aarch64-luajit.tar.gz
+ tar -zxv -C /Users/daiego/.vim/plugged/avante.nvim/build
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 8556k 0 16384 0 0 15240 0 0:09:34 0:00:01 0:09:33 15240x avante_repo_map.dylib
x avante_templates.dylib
100 8556k 100 8556k 0 0 6635k 0 0:00:01 0:00:01 --:--:-- 38.9M
I still get the error around "avante_repo_map", I'm using an M1 chip (arm64), not sure if that's supported atm or not.
I also tried to build from source and although everything runs fine, as soon as I open neovim I see the error popup again.
@itsdaiego there have been a few changes to avante.nvim in the past 24 hours. Have you updated? What version do you have?
If you want to try building from source, what versions of cargo and rustc are in your PATH? If your rust tools are OK, try building manually with:
make BUILD_FROM_SOURCE=true
in the avante.nvim directory mentioned here:
https://github.com/yetone/avante.nvim/issues/612#issuecomment-2375729928
Rustc version
building from source:
Plug Update
Then I open neovim:
I feel like I'm forgetting to do something 😅 , but I cant figure out what it is
I beleive the latest update resolved this error for me, just as an extra data point if anyone finds it helpful.
Maybe I'm doing something wrong, but although everything seems to be executed smoothly:
LUA_VERSION=luajit bash ./build.sh + mkdir -p /Users/daiego/.vim/plugged/avante.nvim/build + curl -L https://github.com/yetone/avante.nvim/releases/download/v0.0.8/avante_lib-darwin-aarch64-luajit.tar.gz + tar -zxv -C /Users/daiego/.vim/plugged/avante.nvim/build % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 8556k 0 16384 0 0 15240 0 0:09:34 0:00:01 0:09:33 15240x avante_repo_map.dylib x avante_templates.dylib 100 8556k 100 8556k 0 0 6635k 0 0:00:01 0:00:01 --:--:-- 38.9M
I still get the error around "avante_repo_map", I'm using an M1 chip (arm64), not sure if that's supported atm or not.
I also tried to build from source and although everything runs fine, as soon as I open neovim I see the error popup again.
Working on my macbook air m1, but weirdly I get the same error as the op when running it inside a ubuntu image in parallels. It builds fine too, but even using make BUILD_FROM_SOURCE=true
it still throws an error.
Any ideas? Previous comment said linux is working but maybe not ubuntu?
i'm on pop, which should be ubuntu-equivalent -- quick note that it functioned normally when i used the minimal config and built correctly, but when i received the error, it didn't appear to perform the build step at all, so perhaps your error is slightly different than mine
Just an update, in my case was a setup mistake, I wasn't loading avante_lib
(I use Plug), after loading both avante
and avante_lib
I'm able to install it without any errors 👍🏽
@itsdaiego Can you elaborate, please? I think I'm doing this, but I don't quite understand how.
@retarpt I literally load avante_lib
then avante
as follows:
lua << EOF
require('avante_lib').load()
require('avante').setup({
provider = "claude", -- Recommend using Claude
auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-3-5-sonnet-20240620",
temperature = 0,
max_tokens = 4096,
},
behaviour = {
auto_suggestions = false, -- Experimental stage
auto_set_highlight_group = true,
auto_set_keymaps = true,
auto_apply_diff_after_generation = false,
support_paste_from_clipboard = false,
},
mappings = {
--- @class AvanteConflictMappings
diff = {
ours = "co",
theirs = "ct",
all_theirs = "ca",
both = "cb",
cursor = "cc",
next = "]x",
prev = "[x",
},
suggestion = {
accept = "<M-l>",
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
jump = {
next = "]]",
prev = "[[",
},
submit = {
normal = "<CR>",
insert = "<C-s>",
},
sidebar = {
switch_windows = "<Tab>",
reverse_switch_windows = "<S-Tab>",
},
},
hints = { enabled = true },
windows = {
---@type "right" | "left" | "top" | "bottom"
position = "right", -- the position of the sidebar
wrap = true, -- similar to vim.o.wrap
width = 50, -- default % based on available width
sidebar_header = {
align = "center", -- left, center, right for title
rounded = true,
},
},
highlights = {
---@type AvanteConflictHighlights
diff = {
current = "DiffText",
incoming = "DiffAdd",
},
},
--- @class AvanteConflictUserConfig
diff = {
autojump = true,
---@type string | fun(): any
list_opener = "copen",
},
})
EOF
Hopefully that will work for you as well 🙏🏽
Make sure you are building the lib correctly though
Please include the required rust version in the install document.
@retarpt I literally load
avante_lib
thenavante
as follows:lua << EOF require('avante_lib').load() require('avante').setup({ provider = "claude", -- Recommend using Claude auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot claude = { endpoint = "https://api.anthropic.com", model = "claude-3-5-sonnet-20240620", temperature = 0, max_tokens = 4096, }, behaviour = { auto_suggestions = false, -- Experimental stage auto_set_highlight_group = true, auto_set_keymaps = true, auto_apply_diff_after_generation = false, support_paste_from_clipboard = false, }, mappings = { --- @class AvanteConflictMappings diff = { ours = "co", theirs = "ct", all_theirs = "ca", both = "cb", cursor = "cc", next = "]x", prev = "[x", }, suggestion = { accept = "<M-l>", next = "<M-]>", prev = "<M-[>", dismiss = "<C-]>", }, jump = { next = "]]", prev = "[[", }, submit = { normal = "<CR>", insert = "<C-s>", }, sidebar = { switch_windows = "<Tab>", reverse_switch_windows = "<S-Tab>", }, }, hints = { enabled = true }, windows = { ---@type "right" | "left" | "top" | "bottom" position = "right", -- the position of the sidebar wrap = true, -- similar to vim.o.wrap width = 50, -- default % based on available width sidebar_header = { align = "center", -- left, center, right for title rounded = true, }, }, highlights = { ---@type AvanteConflictHighlights diff = { current = "DiffText", incoming = "DiffAdd", }, }, --- @class AvanteConflictUserConfig diff = { autojump = true, ---@type string | fun(): any list_opener = "copen", }, }) EOF
Hopefully that will work for you as well 🙏🏽
Make sure you are building the lib correctly though
I just want to add that this solution worked for me. Avante doesn't provide Packer installation instructions, and it's critical to add the avante_lib line before loading avante to avoid errors.
Describe the bug
Freshly installed avante.nvim, attempted the build="make BUILD_FROM_SOURCE=true" modification as well as build="make", still getting the following after a successful open + attempt to avante ask
E5108: Error executing lua: ...ocal/share/Kickstart/lazy/avante.nvim/lua/avante/llm.lua:61: Make sure to build avante (missing avante_templates) stack traceback: [C]: in function 'error' ...cal/share/Kickstart/lazy/avante.nvim/lua/avante/path.lua:75: in function 'get' ...ocal/share/Kickstart/lazy/avante.nvim/lua/avante/llm.lua:61: in function 'stream' .../share/Kickstart/lazy/avante.nvim/lua/avante/sidebar.lua:1299: in function 'handle_submit' .../share/Kickstart/lazy/avante.nvim/lua/avante/sidebar.lua:1353: in function <.../share/Kickstart/lazy/avante.nvim/lua/avante/sidebar.lua:1343>
To reproduce
install via lazy as directed in README.md:
.config/Kickstart/lua/custom/plugins:
Expected behavior
Ask succeeds.
Environment
NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info
Repro