neorg
neorg copied to clipboard
Rocks install neorg: setup() errors on nvim-treesitter.ts_utils
Prerequisites
- [X] I am using the latest stable release of Neovim
- [X] I am using the latest version of the plugin
Neovim Version
NVIM v0.10.0-dev-2698+g00e71d3da3
Neorg setup
require("neorg").setup()
Actual behavior
Neorg not loading at all. Error message:
Error detected while processing /home/myuser/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/rocks.nvim/2.19.1-1/plugin/rocks.lua:
E5113: Error while calling lua chunk: ...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: ...ua/neorg/modules/core/integrations/treesitter/module.lua:53: Unable to load nvim-treesitter.ts_utils :(
stack traceback:
[C]: in function 'error'
...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: in function 'setup'
...rocks/rocks_rtp/lua/rocks-config/rocks/hooks/preload.lua:20: in function 'hook'
...local/share/nvim/rocks/rocks_rtp/lua/rocks/api/hooks.lua:63: in function 'run_preload_hooks'
.../luarocks/rocks-5.1/rocks.nvim/2.19.1-1/plugin/rocks.lua:31: in main chunk
Expected behavior
No error & being able to start using :Neorg
Steps to reproduce
- install nvim
- follow instructions for setting up rocks from https://github.com/nvim-neorocks/rocks.nvim (e.g. run: nvim -u NORC -c "source https://raw.githubusercontent.com/nvim-neorocks/rocks.nvim/master/installer.lua")
- exec Rocks install rocks-config.nvim
- exec Rocks install neorg
- echo "require("neorg").setup()" >> .config/nvim/lua/plugins/neorg.lua
Potentially conflicting plugins
No other plugins, installed everything fresh, followed instructions
Other information
Also tried with other versions of nvim (installed via archlinux > nvim, nvim-git and/or nvim-nightly)
Help
None
Implementation help
No response
Hey, one of the rocks.nvim
developers here :)
Currently the nvim-treesitter
plugin in Luarocks has some problems that I will describe below, so if you don't want to read all that, I will tell you the direct solution before the explanation :p
It will be best if you use rocks-git.nvim (which is a rocks.nvim
extension to also install plugins through Git) to install nvim-treesitter
currently.
But why?
nvim-treesitter
versioning is not semantic, and is really strange, which makes it unreliable.
The original nvim-treesitter
package (neovim/nvim-treesitter) follows this version, which is not bad, but it has some trade-offs. off:
- In the latest version available there is a bug with the parser installation directory since luarocks does not follow the directory hierarchy that
nvim-treesitter
normally expects to have. - Since plugin releases are not updated very frequently, some parsers can break because the tree-sitter queries are handled directly by
nvim-treesitter
, so they can become obsolete if there is a change that breaks in some parser (e.g. thejavascript
parser is completely broken when you enter a.js
file)
Now, if that version works, why the errors? This is because the nvim-neorocks team behind rocks.nvim
maintains a repository of user rocks (NURR) which has priority on the hosts that use rocks.nvim
to get rocks and the version of nvim-treesitter
that is in that repository is the main
branch (needs Neovim nightly!), in which the nvim-treesitter
team is constantly rewriting the plugin and removing things that already exist in the vim.treesitter
API, and one of those things is used by neorg
, which which causes neorg
to break due to its absence :(
Perfect. Thanks for the extensive explanation that was really helpful.
I now have installed treesitter via rocks-git.nvim & it is included in the rocks.toml like:
[plugins.nvim-treesitter]
git = "nvim-treesitter/nvim-treesitter"
rev = "v0.9.2^{}"
and it works now!
Small notes just for interest
- running :Neorg sync-parsers echos some nvim-treesitter things but nothing breaks as a result (apparently)
- I use :TSInstall for all the parsers now rather than rocks & this doesn't seem to create any issues at all
Same error, i have rocks-tresitter
I've since added information in the README how to temporarily overcome the issues related to nvim-treesitter :)
I plan on dropping nvim-treesitter
as a dependency of Neorg, but until that happens the workarounds present there will be required!