bug: Unable to call the plugin after building correctly with minimal config on macOS
Describe the bug
I'm unable to run Avante on my System. It seems to build correctly, and I believe the configuration is fine.
When trying to call any function, I get this type of error:
:AvanteAsk
Error executing Lua callback: ...avante.nvim/lua/avante/api.lua:132: attempt to index field 'windows' (a nil value) stack traceback: ...avante.nvim/lua/avante/api.lua:132: in function 'ask'
When starting neovim (Goes away by removing opts = {}, field in config):
Failed to run config for avante.nvim ...lazy.nvim/lua/lazy/core/loader.lua:387: attempt to call field 'setup' (a nil value)
To reproduce
Call :AvanteAsk or any command.
Expected behavior
No response
Installation method
Installed via Lazy.nvim Tried this: https://github.com/yetone/avante.nvim/issues/977#issuecomment-2560570971 , but it just gives the error mentioned above at startup and still doesn't work.
Using both version = false and version = "*" produce the same result as of today.
Tried building using:
- build = "make BUILD_FROM_SOURCE=true",
- build = "make",
- Building manually running make BUILD_FROM_SOURCE in ~/.local/share/nvim/lazy/avante.nvim
It seems to build successfully, and I get avante_repo_map.dylib avante_templates.dylib avante_tokenizers.dylib in the build folder.
I have followed the steps mentioned here https://github.com/yetone/avante.nvim/issues/612#issuecomment-2375729928, but It doesn't resolve the issue.
Also removed every plugin: rm -rf ~/.local/share/nvim/lazy/* ; rm -rf ~/.local/state/nvim/lazy and ran it with the minimal config below with no success.
Environment
- neovim: 0.10.3
- System: macOS 15.2 ( M1 air )
- rustc: 1.84.0
- Lua: 5.4.7
- uname -a: Darwin J-Air 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 18:40:14 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T8103 arm64
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 = {
{
"yetone/avante.nvim",
build = "make",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"stevearc/dressing.nvim",
},
}
},
})
I also get the this error when I trigger :AvanteAsk
Error executing Lua callback: ....local/share/nvim/plugged/avante.nvim/lua/avante/api.lua:132: attempt to index field 'windows' (a nil value)
stack traceback:
....local/share/nvim/plugged/avante.nvim/lua/avante/api.lua:132: in function 'ask'
.../.local/share/nvim/plugged/avante.nvim/plugin/avante.lua:70: in function <.../.local/share/nvim/plugged/avante.nvim/plugin/avante.lua:54>
Here is the Avante-part of my .vimrc
" Deps
Plug 'stevearc/dressing.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make' }
call plug#end()
autocmd! User avante.nvim
\ lua require('avante_lib').load() |
\ lua require('avante').setup({})
The README suggested this config, but NeoVim would not load that:
autocmd! User avante.nvim lua << EOF
require('avante_lib').load()
require('avante').setup()
EOF
The error:
Error detected while processing BufWritePost Autocommands for "/Users/martins/.vimrc"..script /Users/martins/.vimrc:
line 161:
E492: Not an editor command: require('avante_lib').load()
line 162:
E492: Not an editor command: require('avante').setup({})
line 163:
E492: Not an editor command: EOF
I ran the make command manually, and that worked without any errors:
➜ cd ~/.local/share/nvim/plugged/avante.nvim
➜ avante.nvim git:(main) make
LUA_VERSION=luajit bash ./build.sh
+ mkdir -p /Users/martins/.local/share/nvim/plugged/avante.nvim/build
+ curl -L https://github.com/yetone/avante.nvim/releases/download/v0.0.15/avante_lib-darwin-aarch64-luajit.tar.gz
+ tar -zxv -C /Users/martins/.local/share/nvim/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
16 9654k 16 1551k 0 0 1707k 0 0:00:05 --:--:-- 0:00:05 1707k
x avante_templates.dylib
100 9654k 100 9654k 0 0 7262k 0 0:00:01 0:00:01 --:--:-- 18.8M
Same problem here.
Running make manually did not solve the problem.
Same here after following vimplug setup
the same issue for me, i tried manually and follow https://github.com/yetone/avante.nvim/issues/977#issuecomment-2560570971 as well.