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

bug: E5108: Error executing lua [string ":lua"]:7: module 'avante_lib' not found #565

Open
mrusme opened this issue Sep 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@mrusme
Copy link

mrusme commented Sep 11, 2024

Describe the bug

Followed the installation instructions for vim-plug and made sure to go into ~/.local/share/nvim/plugged/avante.nvim and run make BUILD_FROM_SOURCE=true, however, upon launching nvim I'm getting:

Error detected while processing ~/.config/nvim/init.vim:
line 1064:
E5108: Error executing lua [string ":lua"]:7: module 'avante_lib' not found:
        no field package.preload['avante_lib']
        no file './avante_lib.lua'
        no file '/usr/share/luajit-2.1/avante_lib.lua'
        no file '/usr/local/share/lua/5.1/avante_lib.lua'
        no file '/usr/local/share/lua/5.1/avante_lib/init.lua'
        no file '/usr/share/lua/5.1/avante_lib.lua'
        no file '/usr/share/lua/5.1/avante_lib/init.lua'
        no file './avante_lib.so'
        no file '/usr/local/lib/lua/5.1/avante_lib.so'
        no file '/usr/lib64/lua/5.1/avante_lib.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:7: in main chunk
Press ENTER or type command to continue

To reproduce

No response

Expected behavior

No response

Environment

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1716656478
Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -march=znver3 -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=512   -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fsigned-char -fstack-protector-strong -Wno-conversion -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always  -DUNIT_TESTING -DHAVE_UNIBILIUM -D_GNU_SOURCE -DINCLUDE_GENERATED_DECLARATIONS -I/usr/include/luajit-2.1 -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.10.1/work/neovim-0.10.1_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.10.1/work/neovim-0.10.1_build/include -I/var/tmp/portage/app-editors/neovim-0.10.1/work/neovim-0.10.1_build/cmake.config -I/var/tmp/portage/app-editors/neovim-0.10.1/work/neovim-0.10.1/src

   system vimrc file: "/etc/vim/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Repro

Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': { -> avante#build('source=true') }, 'on': 'AvanteAsk' }

...

lua << EOF
require('img-clip').setup ({
})
require('copilot').setup ({
})
require('render-markdown').setup ({
})
require('avante_lib').load()
require('avante').setup ({
})
EOF
@mrusme mrusme added the bug Something isn't working label Sep 11, 2024
@aarnphm
Copy link
Collaborator

aarnphm commented Sep 11, 2024

can you just try "do": "make"?

@mrusme
Copy link
Author

mrusme commented Sep 12, 2024

Removed the plug, ran PlugClean, changed it to

Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make', 'on': 'AvanteAsk' }

and ran PlugInstall. I saw it downloading an .so file. However, the result is still the same unfortunately.

@santosh-wadghule-zendesk

Removed the plug, ran PlugClean, changed it to

Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make', 'on': 'AvanteAsk' }

and ran PlugInstall. I saw it downloading an .so file. However, the result is still the same unfortunately.

The same error I am getting.

@snowphone
Copy link

snowphone commented Sep 14, 2024

It seems it works by manually add import path like this:

-- .vimrc: Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make', 'on': 'AvanteAsk' }

-- ...
package.path = string.format("%s;%s/.vim/plugged/avante.nvim/lua/?.lua", package.path, os.getenv("HOME"))
package.path = string.format("%s;%s/.vim/plugged/avante.nvim/lua/?/init.lua", package.path, os.getenv("HOME"))
require('avante_lib').load()
-- ...

Note that I am not a lua programmer so the snippet might be not clean enough.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 15, 2024

Ok, this is hacky, avante_lib should check VIMRUNTIME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants