Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Failed via vim-plug #453

Closed
Kaoruha opened this issue Sep 2, 2024 · 11 comments
Closed

Install Failed via vim-plug #453

Kaoruha opened this issue Sep 2, 2024 · 11 comments

Comments

@Kaoruha
Copy link

Kaoruha commented Sep 2, 2024

I installed the lib via vim-plug, but got the following error log.

1 Updated. Elapsed time: 2.031265 sec.
1 [====================x]
2
3 - Finishing ... Done!
4 x Post-update hook for avante.nvim ... Vim:E492: Not an editor command: AvanteBuild
how to fix~

@aarnphm aarnphm closed this as completed in 2b4dff4 Sep 2, 2024
@snowphone
Copy link

Does Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': { -> avante#build() }, 'on': 'AvanteAsk' } work on the latest vim-plug & neovim 0.10.1?
When I try it, it raises an error like this:

x Post-update hook for avante.nvim ... Vim(source):E5113: Error while calling lua chunk: /home/sixtyfive/.vim/plugged/avante.nvim/plugin/avante.lua:13: module 'avante.clipboard' not found:
	no field package.preload['avante.clipboard']
	no file './avante/clipboard.lua'
	no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/avante/clipboard.lua'
	no file '/usr/local/share/lua/5.1/avante/clipboard.lua'
	no file '/usr/local/share/lua/5.1/avante/clipboard/init.lua'
	no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/avante/clipboard.lua'
	no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/avante/clipboard/init.lua'
	no file './avante/clipboard.so'
	no file '/usr/local/lib/lua/5.1/avante/clipboard.so'
	no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/avante/clipboard.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file './avante.so'
	no file '/usr/local/lib/lua/5.1/avante.so'
	no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/avante.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	/home/sixtyfive/.vim/plugged/avante.nvim/plugin/avante.lua:13: in main chunk

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 4, 2024

did you call require("avante").setup()? please read the readme

@snowphone
Copy link

snowphone commented Sep 5, 2024

Here's my init.lua. In detail, after .vimrc (with vim-plug) in sourced, init.lua is invoked in my configuration.

...
require('img-clip').setup({
	-- recommended settings
	default = {
		embed_image_as_base64 = false,
		prompt_for_file_name = false,
		drag_and_drop = {
			insert_mode = true,
		},
	},
})
require('render-markdown').setup {
	file_types = { "markdown", "Avante" },
	enable = true,
}
require('avante_lib').load()
require('avante').setup {
	provider = "openai",
	mappings = {
		submit = {
			normal = "<C-j>",
			insert = "<C-j>",
		},
	},
}
...

Since I use openapi, I popped out copilot.lua and related config.

@Kaoruha
Copy link
Author

Kaoruha commented Sep 5, 2024

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

Here's my init.vim configuration file, with unrelated plugin sections removed.

call plug#begin('~/.config/nvim/plugged')


" Deps
Plug 'stevearc/dressing.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'MunifTanjim/nui.nvim'

" Optional deps
Plug 'nvim-tree/nvim-web-devicons' "or Plug 'echasnovski/mini.icons'
Plug 'HakonHarnes/img-clip.nvim'
Plug 'zbirenbaum/copilot.lua'

" Yay, pass source=true if you want to build from source
Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': { -> avante#build() }, 'on': 'AvanteAsk' }


call plug#end()

lua << EOF

require('avante_lib').load()

EOF
Updated. Elapsed time: 7.073995 sec.                                                                                                                                                                                         
  1 [====================x]
  2 
  3 - Finishing ... Done!
  4 x Post-update hook for avante.nvim ... Vim(source):E5113: Error while calling lua chunk: ...kaoru/.config/nvim/plugged/avante.nvim/plugin/avante.lua:13: module 'avante.clipboard' not found:^@ no field package.preload['ava
  5 - avante.nvim: Already up to date.
  6 - indentLine: Already installed

Seems faild at buildindg function.

I have checked runtimepath, and the path for avante.nvim was not added.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 5, 2024

#541 should address this.

@snowphone
Copy link

snowphone commented Sep 5, 2024

I tried with my configuration and @Kaoruha's minimal configuration, but it failed in both cases. I double-checked that the vim-plug downloaded the latest main branch (33c9ac2).

It seems lazy loading technique ('on': 'AvanteAsk') does not work on vim-plug. Maybe avante.nvim must be loaded before invoking any lua command (such as require).

x Post-update hook for avante.nvim ... Vim(source):E5113: Error while calling lua chunk: /Users/junohmoon/.vim/plugged/avante.nvim/plugin/avante.lua:13: module 'avante.clipboard' not found:
	no field package.preload['avante.clipboard']
	no file './avante/clipboard.lua'
	no file '/usr/local/share/luajit-2.1/avante/clipboard.lua'
	no file '/usr/local/share/lua/5.1/avante/clipboard.lua'
	no file '/usr/local/share/lua/5.1/avante/clipboard/init.lua'
	no file './avante/clipboard.so'
	no file '/usr/local/lib/lua/5.1/avante/clipboard.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file './avante.so'
	no file '/usr/local/lib/lua/5.1/avante.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	/Users/junohmoon/.vim/plugged/avante.nvim/plugin/avante.lua:13: in main chunk

@snowphone
Copy link

As a result, I use Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': { -> avante#build('source=true') } } to give up lazy loading and confirm it runs without errors.

@ericzwong
Copy link

As a result, I use Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': { -> avante#build('source=true') } } to give up lazy loading and confirm it runs without errors.

When I tried to run the new one, I encountered "avante.nvim ... Vim(return):E118: Too many arguments for function: join" on my side.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 6, 2024

@ericzwong sorry for the ping, can you try with this #550?

@ericzwong
Copy link

@ericzwong sorry for the ping, can you try with this #550?

It works for me.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 6, 2024

Thanks for going through all the trouble, appreciate it a ton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants