saecki/crates.nvim

Lua error

Closed this issue · 9 comments

Current behavior

After installation via vim-plug the lua line causes an error.
Error executing string 'crates' module not found.

E5108: Error executing lua [string ":lua"]:1: module 'crates' not found: no field package.preload['crates'] no file './crates.lua' no file '/usr/share/luajit-2.1.0-beta3/crates.lua' no file '/usr/local/share/lua/5.1/crates.lua' no file '/usr/local/share/lua/5.1/crates/init.lua' no file '/usr/share/lua/5.1/crates.lua' no file '/usr/share/lua/5.1/crates/init.lua' no file './crates.so' no file '/usr/local/lib/lua/5.1/crates.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.1/crates.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' [string ":lua"]:1: in main chunk

Expected behavior

Expected it to setup

Possible solution

I tried creating a ./crates.lua file and putting in the default config in there but it did not resolve anything. Also tried a few of the other places it searched.
I also tried the neovim 0.8.0 appimage but when that did not work either i reverted back to the one I had installed previously.

Neovim version

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

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

Run :checkhealth for more info

Seems like something went wrong installing the plugin, did you run PlugInstall?

Yes, i even ran PlugUpdate and PlugUgrade to update all the plugins and vim-plug itself.
I tried the lua line both in and out of my call plug section too

The error above says that the plugin isn't found and it doesn't list any vim-plug directory (unless you remvoed that from the error message). Are you sure you've set up vim-plug correctly? Do you have other plugins that are working fine?

Error detected while processing /home/izzyd/.config/nvim/init.vim: line **21:
That is the line before.
I do have vim-plug set up right AFAIK. All my other plug-ins, nerdtree, airline, coc, and fzf all work along with my javascript ones.

Did you maybe try to call setup before vim plug plugins are loaded?

I did. I just ran check health, and saw i was missing a dependency, null-ls.nvim, so I installed that. Now I am getting this:
Error detected while processing /home/izzyd/.config/nvim/init.vim: line 24: E5108: Error executing lua ...local/share/nvim/plugged/crates.nvim/lua/crates/init.lua:78: attempt to call field 'nvim_create_augroup' (a nil value) stack traceback: ...local/share/nvim/plugged/crates.nvim/lua/crates/init.lua:78: in function 'setup' [string ":lua"]:1: in main chunk

My guess is I need to update past 0.6.1 as nvim_create_augroup doesn't seem to be a thing I can call on my current version.

EDIT: My guess was correct. If I use the appimage of 0.8.0 it works flawlessly. It seems that call of nvim_create_augroup does not exist in the 0.6.1 version which is what apt and apt-get install still.

To use with neovim 0.6.1 you can use a tagged release as shown in the readme

To use with neovim 0.6.1 you can use a tagged release as shown in the readme

Did the readme.
Plug 'saecki/crates.nvim', { 'tag': 'v0.3.0' }
That is in the init file and it presents the problem above with neovim 0.6.1.

Oh, right you'll have to use v0.2.1