NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.64k stars 13.8k forks source link

LunarVim: `nvim-treesitter` error #312971

Open cig0 opened 4 months ago

cig0 commented 4 months ago

Describe the bug

About a week ago, I started seeing this error message at LV launch:

Failed to source `/home/cig0/.local/share/lvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua`

vim/_editor.lua:0: BufReadPre Autocommands for "*"..script nvim_exec2() called at BufReadPre Autocommands for "*":0../home/cig0/.local/share/lvim/site/pack/lazy/opt/bigfile.nvim/after/plugin/bigfile.lua.
.nvim_exec2() called at /home/cig0/.local/share/lvim/site/pack/lazy/opt/bigfile.nvim/after/plugin/bigfile.lua:0../home/cig0/.local/share/lvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua
: Vim(source):E5113: Error while calling lua chunk: ...d-0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:651: Overriding existing predicate has-ancestor?                                           
stack traceback:                                                                                                                                                                                           
^I[C]: in function 'error'                                                                                                                                                                                 
^I...d-0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:651: in function 'add_predicate'                                                                                                             
^I...nvim-treesitter/lua/nvim-treesitter/query_predicates.lua:74: in main chunk                                                                                                                            
^I[C]: in function 'require'                                                                                                                                                                               
^I...te/pack/lazy/opt/nvim-treesitter/lua/nvim-treesitter.lua:8: in main chunk                                                                                                                             
^I[C]: in function 'require'                                                                                                                                                                               
^I...pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua:9: in main chunk                                                                                                                             
^I[C]: in function 'nvim_exec2'                                                                                                                                                                            
^Ivim/_editor.lua: in function 'cmd'                                                                                                                                                                       
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:438: in function <...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:437>                                                           
^I[C]: in function 'xpcall'                                                                                                                                                                                
^I...                                                                                                                                                                                                      
^Ivim/_editor.lua: in function 'cmd'                                                                                                                                                                       
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:438: in function <...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:437>                                                           
^I[C]: in function 'xpcall'                                                                                                                                                                                
^I...lvim/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/util.lua:110: in function 'try'                                                                                                                       
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:437: in function 'source'                                                                                                                    
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:396: in function 'source_runtime'                                                                                                            
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:367: in function 'packadd'                                                                                                                   
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:304: in function '_load'                                                                                                                     
^I...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:180: in function 'load'                                                                                                                      
^I.../pack/lazy/opt/lazy.nvim/lua/lazy/core/handler/event.lua:33: in function <.../pack/lazy/opt/lazy.nvim/lua/lazy/core/handler/event.lua:26>                                                             

# stacktrace:                                                                                                                                                                                              
  - vim/_editor.lua:0 _in_ **cmd**                                                                                                                                                                         
  - /bigfile.nvim/lua/bigfile/init.lua:77 _in_ **configure_treesitter_disable**                                                                                                                            
  - /bigfile.nvim/lua/bigfile/init.lua:117 _in_ **setup**                                                                                                                                                  
  - /bigfile.nvim/after/plugin/bigfile.lua:7                                                                                                                                                               
  - vim/_editor.lua:0 _in_ **cmd**                                                                                                                                                                         
Press ENTER or type command to continue             

I tried removing the plugin directory inside .local/share, but the error shows up again.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Launch LunarVim
  2. Open a file (any type of file)
  3. ...

Expected behavior

No error message message should appear.

Screenshots

If applicable, add screenshots to help explain your problem. image

Additional context

I've used this package for almost a month and have never seen this error before.

Notify maintainers

@ProminentRetail

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.1, NixOS, 24.05 (Uakari), 24.05.20240517.4a6b83b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/0aavdx9m5ms1cj5pb1dx0brbrbigy8ij-source`

Add a :+1: reaction to issues you find important.

arevno commented 4 months ago

(Not a Nix User, found this issue by googling)

FWIW, this is also an issue with LunarVim in Arch, as of the most recent update.

Exact same error and stacktrace. Likely some change in lua or neovim upstream that both Nix and Arch picked up.

arevno commented 4 months ago

Following up, the issue appears to be in neovim-0.10.0-1 (at least on Arch, I assume the same for Nix?). After downgrading to neovim-0.9.5-6, everything works fine again.

Luis-Marins commented 4 months ago

same bug here! i use arch 6.9.1-arch1-1 ...

cig0 commented 4 months ago

Thanks, @arevno and @Luis-Marins, for confirming the issue. Salim, the main dev of LunarVim, said on their Discord:

image

@lebensterben Given what Salim said, I propose:

  1. Pinning the neovim package version in your package to 0.95 will solve the issues for now.
  2. Creating a new package lunarvim-nightly so folks can still use Neovim 0.10 if they prefer that.

I'll be more than glad to lend a hand. I'd love to learn what you think!

Thanks

cig0 commented 4 months ago

Also, I believe it's worth sharing this other bit:

image

Salim's response to https://www.reddit.com/r/lunarvim/comments/1cafb7v/lunarvim_has_been_abandoned_by_maintainers/

nixos-discourse commented 4 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-pin-a-specific-version-for-neovim/45895/1