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

Failed to source plugin/nvim-treesitter.lua #4421

Closed
palandovalex opened this issue Nov 21, 2023 · 45 comments
Closed

Failed to source plugin/nvim-treesitter.lua #4421

palandovalex opened this issue Nov 21, 2023 · 45 comments
Labels
bug Something isn't working

Comments

@palandovalex
Copy link

Problem description

When start lvim - i have this stacktrace:

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

vim/_editor.lua:0: BufReadPre Автокоманды для "*"..script nvim_exec2() called at BufReadPre Автокоманды для "*":0../home/user/.local/share/lunarvim/site/pack/lazy/opt/bigfile.nvim/after/plugin/bigfile.lua..nvim_exec2() called at /home/user/.local/sh
are/lunarvim/site/pack/lazy/opt/bigfile.nvim/after/plugin/bigfile.lua:0../home/user/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua: Vim(source):E5113: Error while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesi
tter/query.lua:533: Overriding has-ancestor?
stack traceback:
^I[C]: in function 'error'
^I/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:533: in function 'add_predicate'
^I...nvim-treesitter/lua/nvim-treesitter/query_predicates.lua:94: 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...rvim/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**

LunarVim version

master-9dc549a4

Neovim version (>= 0.9.1)

neovim-0.10.0~ubuntu1+git202311192034-7ca2d64e8-c60402a16

Terminal name

Terminator

Operating system/version

Linux mint 21.04.1, kernel - 6.2.0-36-generic

Steps to reproduce

it hapends on clear installition

Screenshots

No response

@palandovalex palandovalex added the bug Something isn't working label Nov 21, 2023
@chase
Copy link
Collaborator

chase commented Nov 23, 2023

This happened to me too after upgrading to 0.10, unfortunately I forget exactly what I did to fix it.

I think I had to clear the LunarVim cache and re-install the treesitter modules.

@totallypredictable
Copy link

totallypredictable commented Dec 10, 2023

I had the same issue on macOS 14.1.2 (23B92).
With neovim version: NVIM v0.10.0-dev-1328+g37da0bc0c-Homebrew
In my case, doing :Lazy sync in lvim fixed it for me.

@thepixelmonk
Copy link

:Lazy sync doesn't seem to fix it over here.

@MaxAlex
Copy link

MaxAlex commented Dec 28, 2023

Same issue on Ubuntu 22.04;
NVIM v0.10.0-dev-1934+g031088fc0
Build type: RelWithDebInfo
LuaJIT 2.1.1702233742

:Lazy sync doesn't fix it, nor does clearing cache followed by a clean reinstall of the lazy package directory.

Copy link
Contributor

This issue is stale because it has been open for 50 days with no activity.

@github-actions github-actions bot added the stale label Feb 17, 2024
@musamaanjum
Copy link

Facing the same issue

@github-actions github-actions bot removed the stale label Feb 29, 2024
@Nosterx
Copy link

Nosterx commented Mar 1, 2024

Same here =( Anyone managed to fix this?

@aadityasinha-dotcom
Copy link

Same issue for me neither Lazy sync nor clearing cache works for me

@azizuysal
Copy link

Same issue here, no solution in 6 months?

@fastfading
Copy link

me too

@PannenetsF
Copy link

me too, but for bigfile.nvim

@karankumbhar47
Copy link

me too

@kylo252
Copy link
Collaborator

kylo252 commented May 15, 2024

Let me know if this is still an issue in https://github.com/LunarVim/LunarVim/releases/tag/1.4.0

@kylo252 kylo252 closed this as completed May 15, 2024
@srgvg
Copy link

srgvg commented May 16, 2024

Still an issue after re-installing to release-1.4/neovim-0.9-d15c8d7 (as the in-app upgrade command didn't detect 1.4 yet)

@walkccc
Copy link

walkccc commented May 18, 2024

Had the same issue. Installing the Nightly version and running :Lazy sync solved the problem.

$ lvim --version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

@kylo252
Copy link
Collaborator

kylo252 commented May 20, 2024

@srgvg, @walkccc
are you guys running latest nightly release?

@kylo252 kylo252 reopened this May 20, 2024
@kylo252 kylo252 changed the title Failed to source /home/user/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua Failed to source plugin/nvim-treesitter.lua May 20, 2024
@littleblack111
Copy link

Same here. I'm on release

Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info```

@Eruant
Copy link

Eruant commented May 21, 2024

This happened after NeoVim was updated to 0.10. 0.9 is no longer the latest release
https://neovim.io/news/2024/05

@matallui
Copy link

I was having the same issue. I installed the nightly build of Lunarvim and that seems to work fine so far. I know this is not ideal. Hope a stable version gets released with support for nvim 0.10

@littleblack111
Copy link

I was having the same issue. I installed the nightly build of Lunarvim and that seems to work fine so far. I know this is not ideal. Hope a stable version gets released with support for nvim 0.10

I am using stable build and its still giving this error

@kylo252
Copy link
Collaborator

kylo252 commented May 22, 2024

can you guys try #4567 and see if it helps?

@littleblack111
Copy link

can you guys try #4567 and see if it helps?

Didn't fix / do anything
I don't get why would changing from config to setup and adding a dependencies will impact the result? And I'm getting it even I have nvim-treesitter installed

@kylo252
Copy link
Collaborator

kylo252 commented May 22, 2024

Didn't fix / do anything I don't get why would changing from config to setup and adding a dependencies will impact the result? And I'm getting it even I have nvim-treesitter installed

I was hoping it would avoid calling the default setup() for bigfile.nvim, and the other change was related to loading treesitter earlier.

could you share the first result of

  • :Lazy log bigfile.nvim
  • :Lazy log nvim-treesitter

@Noxdor
Copy link

Noxdor commented May 23, 2024

Today I updated my system and ran into the same issue:

Failed to source `/home/<username>/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua`

vim/_editor.lua:0: /home/<username>/.local/share/lunarvim/lvim/init.lua..nvim_exec2() called at /home/<username>/.local/share/lunarvim/lvim/init.lua:0../home/lennar
t/.local/share/lunarvim/site/pack/lazy/opt/nvim-nu/plugin/nu.lua..nvim_exec2() called at /home/<username>/.local/share/lunarvim/site/pack/lazy/opt/nvim-nu/plugin
/nu.lua:0../home/<username>/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua: Vim(source):E5113: Error while calling lua chunk
: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:651: Overriding existing predicate has-ancestor?
stack traceback:
[C]: in function 'error'
/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:651: in function 'add_predicate'
...nvim-treesitter/lua/nvim-treesitter/query_predicates.lua:94: in main chunk
[C]: in function 'require'
...te/pack/lazy/opt/nvim-treesitter/lua/nvim-treesitter.lua:8: in main chunk
[C]: in function 'require'
...pack/lazy/opt/nvim-treesitter/plugin/nvim-treesitter.lua:9: in main chunk
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...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>
[C]: in function 'xpcall'
...
...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:396: in function 'source_runtime'
...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:364: in function 'packadd'
...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:304: in function '_load'
...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:180: in function 'load'
...im/site/pack/lazy/opt/lazy.nvim/lua/lazy/core/loader.lua:115: in function 'startup'
.../lunarvim/site/pack/lazy/opt/lazy.nvim/lua/lazy/init.lua:85: in function 'setup'
...rt/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:106: in function <...rt/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:104>
[C]: in function 'xpcall'
...rt/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:104: in function 'load'
/home/<username>/.local/share/lunarvim/lvim/init.lua:17: in main chunk

# stacktrace:
  - vim/_editor.lua:0 _in_ **cmd**
  - /nvim-nu/plugin/nu.lua:1
  - vim/_editor.lua:0 _in_ **cmd**
  - ~/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:106
  - ~/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua:104 _in_ **load**
  - ~/.local/share/lunarvim/lvim/init.lua:17

Unfortunately, running Lazy sync did not fix the issue. I am running the following nvim version:

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

I would prefer not having to switch to nighly. Is there any solution in sight?

EDIT: My temporary workaround is to downgrade neovim to version 0.9.x, if you are using arch linux like me, you can find the way to do it here

@hifigraz
Copy link

Same here:

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

@littleblack111
Copy link

I solved it! Just reinstall... all user config won't be lost

@matallui
Copy link

@littleblack111 Just did the same and it worked! Basically uninstalled and installed again (the stable version this time) and the issue seems to have been fixed.

@littleblack111
Copy link

Basically uninstalled and installed again

Don't even boder uninstalling, just run the installation script again, it will automaticly make up the old .local/share files and replace them with the new ones

@dmitryrn
Copy link

dmitryrn commented May 27, 2024

I fixed it by moving my lvim to lvim.bak, installing the normal (not nightly, that's what I've been using) version of lunarvim, moving my config back, and the error is gone (the config is unchanged)

@kylo252
Copy link
Collaborator

kylo252 commented May 27, 2024

This is probably a Neovim build related issue caused by a mismatch between the provided version of tree-sitter-lua compared to what runtime/lua/vim/treesitter/query.lua is expecting.

Suggested solution: clean build neovim with updated deps

@kfirbreger
Copy link

I had the same issue and just rerunning the install script resolved it for me.

@jonathaw
Copy link

how do you rerun the install script? i used brew reinstall nvim and the issue was not resolved...

@kfirbreger
Copy link

how do you rerun the install script? i used brew reinstall nvim and the issue was not resolved...

I did not rerun nvim install. I reran the lunarvim install script. Even though it seems to indicatie that nvim 0.9 would be installed, the script kept nvim 0.10 for me while fixing whatever it was that was breaking Lunarvim.

@Noxdor
Copy link

Noxdor commented May 29, 2024

how do you rerun the install script? i used brew reinstall nvim and the issue was not resolved...

I did not rerun nvim install. I reran the lunarvim install script. Even though it seems to indicatie that nvim 0.9 would be installed, the script kept nvim 0.10 for me while fixing whatever it was that was breaking Lunarvim.

I just tried this, unfortunately for me it doesn't resolve the error.

@jonathaw
Copy link

i tried the commands at https://www.lunarvim.org/docs/installation#updating-lunarvim, still getting the error

@kfirbreger
Copy link

how do you rerun the install script? i used brew reinstall nvim and the issue was not resolved...

I did not rerun nvim install. I reran the lunarvim install script. Even though it seems to indicatie that nvim 0.9 would be installed, the script kept nvim 0.10 for me while fixing whatever it was that was breaking Lunarvim.

I just tried this, unfortunately for me it doesn't resolve the error.

Did you run sync afterwards?

@kylo252
Copy link
Collaborator

kylo252 commented May 30, 2024

I did not rerun nvim install. I reran the lunarvim install script. Even though it seems to indicatie that nvim 0.9 would be installed, the script kept nvim 0.10 for me while fixing whatever it was that was breaking Lunarvim.

@kfirbreger, the installer does not install Neovim for you, it merely checks that you have v0.9+ installed or not.

i tried the commands at lunarvim.org/docs/installation#updating-lunarvim, still getting the error

@jonathaw and @Noxdor, you guys can also try a clean lunarvim install, and make sure to test it with Neovim v0.9.5 (preferably installed with your package manager to make sure the dependencies are matched correctly).

@kylo252 kylo252 pinned this issue May 30, 2024
@Noxdor
Copy link

Noxdor commented May 30, 2024

jonathaw and @Noxdor, you guys can also try a clean lunarvim install, and make sure to test it with Neovim v0.9.5 (preferably installed with your package manager to make sure the dependencies are matched correctly).

I mentioned above that downgrading Neovim to the latest 0.9.x version solved things for me, without needing to reinstall LunarVim.

@kfirbreger
Copy link

I did not rerun nvim install. I reran the lunarvim install script. Even though it seems to indicatie that nvim 0.9 would be installed, the script kept nvim 0.10 for me while fixing whatever it was that was breaking Lunarvim.

@kfirbreger, the installer does not install Neovim for you, it merely checks that you have v0.9+ installed or not.

i tried the commands at lunarvim.org/docs/installation#updating-lunarvim, still getting the error

@jonathaw and @Noxdor, you guys can also try a clean lunarvim install, and make sure to test it with Neovim v0.9.5 (preferably installed with your package manager to make sure the dependencies are matched correctly).

Ahh that explains it. I am running NeoVim 0.10 btw

@MrGamerDoesGames
Copy link

Had this issue on NixOS Unstable, running Lazy sync fixed it

@jonathaw
Copy link

ended up deleting and reinstall lunarvim from scratch. after Lazy sync, the issue is resolved. thanks!

@javierfraga
Copy link

I had the same issue and just rerunning the install script resolved it for me.

confirmed. this also worked for me Macos M3 Sonoma 14.5
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

@littleblack111
Copy link

@palandovalex close the issue

@kylo252 kylo252 closed this as completed Jun 3, 2024
@isaadoug
Copy link

isaadoug commented Jun 4, 2024

Uninstall then re-install of the release version (not nightly version) fixed the issue for me!

@myryk31415
Copy link

TLDR:

reinstall and then :Lazy sync in LunarVim worked for most people :)

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