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

Luarocks Issues Thread #1342

Open
vhyrro opened this issue Mar 24, 2024 · 91 comments
Open

Luarocks Issues Thread #1342

vhyrro opened this issue Mar 24, 2024 · 91 comments

Comments

@vhyrro
Copy link
Member

vhyrro commented Mar 24, 2024

If you're probably here you're either angry or you're sad :|

The latest update, 8.0.0, has been a breaking change for users. This isn't a breaking change just because I felt like it, rather it paves the way forward for making Neorg expansive and more stable than it was before. We just need to jump through the initial hurdles.

If you have issues, please read the blog post I made. It will have you covered on how to fix things.

If you don't want to deal with the breakages, feel free to roll back to version v7.0.0 - everything will continue to run there.

If you're having errors in lazy, I highly encourage you to restart Neovim and try manually rerunning :Lazy build luarocks.nvim and, if that succeeds, running :Lazy build neorg afterwards. If you get any errors which you do not understand, please post them here!

Thank you lot for the patience! Happy note taking.

EDIT:

If you have a build = ":Neorg sync-parsers" step in your Neorg configuration be sure to remove it. That'll overwrite the build.lua build step and make the build process fail.

@vhyrro vhyrro pinned this issue Mar 24, 2024
@roland-5
Copy link
Contributor

roland-5 commented Mar 24, 2024

I use lazy and :Lazy build luarocks.nvim and :Lazy build neorg indeed helped for error that I had.
Should we install luarock package from our distribution repository too?

@vhyrro
Copy link
Member Author

vhyrro commented Mar 24, 2024

Nope, you don't need the luarocks package from your distro :)

Yeah, sometimes manually rerunning the build steps is what fixes it. Lazy is very unpredictable when it comes to build steps 🤷‍♂️

@pysan3
Copy link
Contributor

pysan3 commented Mar 24, 2024

For those who are on Arch Linux and seeing a build error similar to...

❌ Performing luarocks `./configure` if Unix systems
...hare/nvim/lazy/luarocks.nvim/lua/luarocks-nvim/build.lua:126: Failed to install luarocks: 
Configuring LuaRocks version dev...

Lua interpreter found: /sbin/luajit
Checking if /sbin/luajit is Lua version 5.1... yes
lua.h for Lua 5.1 not found (tried //include/lua/5.1/lua.h //include/lua5.1/lua.h //include/lua-5.1/lua.h //include/lua51/lua.h //include/lua.h //include/luajit-2.1/lua.h)

If the development files for Lua (headers and libraries)
are installed in your system, you may need to use the
--with-lua or --with-lua-include flags to specify their location.

If those files are not yet installed, you need to install
them using the appropriate method for your operating system.

Run ./configure --help for details on flags.

configure failed.

change your luarocks.nvim config as follows.

{
  "vhyrro/luarocks.nvim",
  opts = {
    luarocks_build_args = {
      "--with-lua-include=/usr/include",
    },
  },
}

@simonhughxyz
Copy link

simonhughxyz commented Mar 24, 2024

I'm trying to install it with the lazy method but I keep getting an error and neorg won't load:

Failed to run `config` for neorg
                                                                                                                                         
.../lazy/neorg/lua/neorg/modules/core/highlights/module.lua:433: module 'nvim-treesitter.query' not found:No LuaRocks module found for nv
im-treesitter.query                                                                                                                      
^Ino field package.preload['nvim-treesitter.query']                                                                                      
cache_loader: module nvim-treesitter.query not found                                                                                     
cache_loader_lib: module nvim-treesitter.query not found                                                                                 
^Ino file './nvim-treesitter/query.lua'                                                                                                  
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/nvim-treesitter/query.lua'                                         
^Ino file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua'                                                                           
^Ino file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua'                                                                      
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/nvim-treesitter/query.lua'                                            
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/nvim-treesitter/query/init.lua'                                       
^Ino file '/home/simon/.local/share/nvim/lazy/luarocks.nvim/.rocks/share/lua/5.1/nvim-treesitter/query.lua'                              
^Ino file '/home/simon/.local/share/nvim/lazy/luarocks.nvim/.rocks/share/lua/5.1/nvim-treesitter/query/init.lua'                         
^Ino file '/home/simon/.luarocks/share/lua/5.1/nvim-treesitter/query.lua'                                                                
^Ino file '/home/simon/.luarocks/share/lua/5.1/nvim-treesitter/query/init.lua'                                                           
^Ino file './nvim-treesitter/query.so'                                                                                                   
^Ino file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so'                                                                              
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/nvim-treesitter/query.so'                                               
^Ino file '/usr/local/lib/lua/5.1/loadall.so'                                                                                            
^Ino file '/home/simon/.local/share/nvim/lazy/luarocks.nvim/.rocks/lib/lua/5.1/nvim-treesitter/query.so'                                 
^Ino file '/home/simon/.luarocks/lib/lua/5.1/nvim-treesitter/query.so'                                                                   
^Ino file './nvim-treesitter.so'                                                                                                         
^Ino file '/usr/local/lib/lua/5.1/nvim-treesitter.so'                                                                                    
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/nvim-treesitter.so'                                                     
^Ino file '/usr/local/lib/lua/5.1/loadall.so'                                                                                            
^Ino file '/home/simon/.local/share/nvim/lazy/luarocks.nvim/.rocks/lib/lua/5.1/nvim-treesitter.so'                                       
^Ino file '/home/simon/.luarocks/lib/lua/5.1/nvim-treesitter.so'                                                                         
                                                                                                                                         
# stacktrace:                                                                                                                            
  - /neorg/lua/neorg/modules/core/highlights/module.lua:433 _in_ **trigger_highlights**                                                  
  - /neorg/lua/neorg/modules/core/highlights/module.lua:420 _in_ **load**                                                                
  - /neorg/lua/neorg/core/modules.lua:403 _in_ **load_module**                                                                           
  - /neorg/lua/neorg/core/modules.lua:335 _in_ **load_module**  

@vhyrro
Copy link
Member Author

vhyrro commented Mar 24, 2024

@simonhughxyz The error message is slightly different as we're using the luarocks package loader, but the underlying cause looks to be the same - Neorg is trying to initialize before treesitter is activated.

Maybe try:

{
  "nvim-neorg/neorg",
  dependencies = { "luarocks.nvim", "nvim-treesitter" }, -- Add nvim-treesitter here
}

Just for good measure? I'll be revamping that part of the code fairly soon anyway, but it's worth a shot.

@simonhughxyz
Copy link

"nvim-treesitter"

This fix did not work

@vhyrro
Copy link
Member Author

vhyrro commented Mar 24, 2024

Okay, I tried another thing. @simonhughxyz mind updating the plugin and trying again? I removed the old and hacky code related to nvim-treesitter query invalidation, which has been resolved for a while now.

@simonhughxyz
Copy link

No sorry, updated all plugin, still did not work. Tried deleting my nvim data folder as well just in case, did not resolve anything.

@vhyrro
Copy link
Member Author

vhyrro commented Mar 24, 2024

That's odd... are you pinned to the latest stable release by any chance? I pushed the update to the main branch. If so, my bad, I should have made that clear.

I quite literally removed the old code that cause the error, so it continuing to trigger is quite suspicious 😅

@simonhughxyz
Copy link

Yea, just checked lazy, it says its on commit 388976f. So not latest. Not sure why, I updated neorg and like I said before even tried deleting my data folder.

@simonhughxyz
Copy link

Oh hang on, my bad, I had version = "*" in my lazy setup

@simonhughxyz
Copy link

Ok, so the latest commit got rid of the error, but neorg still will not load

@vhyrro
Copy link
Member Author

vhyrro commented Mar 24, 2024

I assume then that it's silently failing to load? All of the people that have mentioned such an error have had their issues resolved via :Lazy build neorg, which forces a rebuild of the project. After restarting Neovim things should start working once more :)

As I mentioned before, lazy has a notoriously weird set of build procedures.

@simonhughxyz
Copy link

Ok so I fixed it, it just needs 2 dependancies dependencies = { "luarocks.nvim", "nvim-treesitter/nvim-treesitter" },
Everything works now.

@roland-5
Copy link
Contributor

@vhyrro I use Arch and @pysan3 method worked for me. I installed luarock from Arch repository, deleted ~/.local/share/nvim to test this, and with his change, everything were downloaded and built without problem this time.

@pysan3
Copy link
Contributor

pysan3 commented Mar 24, 2024

@roland-5 The workaround will be officially supported so you don't need to add the line in your config anymore. (Obviously adding luarocks_build_args yourself will finish faster cuz the workaround will need to retry a couple of times.)

@xfzv
Copy link
Contributor

xfzv commented Mar 24, 2024

I've just migrated following Adapting your config section, so far so good.

@zvpyp
Copy link

zvpyp commented Mar 25, 2024

I might just add, if you are using fedora, make sure you have installed compat-lua-devel-5.1.5

sudo dnf install compat-lua-devel-5.1.5

The with-lua flag is not necessary since it is installed in a default directory.

Then you do :Lazy build luarocks.nvim and after that :Lazy build neorg

Hope that helps, I was just frustrated searching for the package.

@ALVAROPING1
Copy link
Contributor

ALVAROPING1 commented Mar 25, 2024

For those who are on Arch Linux and seeing a build error similar to...

❌ Performing luarocks `./configure` if Unix systems
...hare/nvim/lazy/luarocks.nvim/lua/luarocks-nvim/build.lua:126: Failed to install luarocks: 
Configuring LuaRocks version dev...

Lua interpreter found: /sbin/luajit
Checking if /sbin/luajit is Lua version 5.1... yes
lua.h for Lua 5.1 not found (tried //include/lua/5.1/lua.h //include/lua5.1/lua.h //include/lua-5.1/lua.h //include/lua51/lua.h //include/lua.h //include/luajit-2.1/lua.h)

If the development files for Lua (headers and libraries)
are installed in your system, you may need to use the
--with-lua or --with-lua-include flags to specify their location.

If those files are not yet installed, you need to install
them using the appropriate method for your operating system.

Run ./configure --help for details on flags.

configure failed.

if you get an issue similar to this on ubuntu based distros, you need to install the liblua5.1-0-dev package

@dearieme
Copy link

Hello, noob question: how do I see the build errors in Lazy?

I'm getting the "Performing luarocks ./configure if Unix systems" message when I run "Lazy build luarocks.nvim" but I can't figure out how to see the full errors. They do not seem to be in ":mess" or "NoiceHistory"

Thanks

@pysan3
Copy link
Contributor

pysan3 commented Mar 25, 2024

@dearieme :Notifications

@dearieme
Copy link

@pysan3 Thank you, I'm sure I knew that once :)

I'm on Arch and the error suggested that lua 5.1 was explicitly required, so I installed"extra/lua51" ("extra/lua" was already installed but didn't conflict) re-did the Lazy build dance, and it all seems to work fine now.

@max397574
Copy link
Contributor

I had strange errors with wget when trying to Lazy build neorg. I found out that just wget was broken (tested with wget --version which gave an error)
Just uninstalling wget made all the things work

@leongjs98
Copy link
Contributor

@vhyrro

I was unable to install Neorg v8 with lazy.nvim with the blog post fix here:

in the readme, it says:

Using luarocks Neorg will install itself and these dependencies with their respective versions:

But for me, it didn't install the dependencies

I had to explicitly add these as dependencies to install Neorg v8:

  {
    "vhyrro/luarocks.nvim",
+   dependencies = {
+     "MunifTanjim/nui.nvim",
+     "nvim-neotest/nvim-nio",
+     "nvim-neorg/lua-utils.nvim",
+     "nvim-lua/plenary.nvim"
+   },
    priority = 1000, -- We'd like this plugin to load first out of the rest
    config = true,   -- This automatically runs `require("luarocks-nvim").setup()`
  },

Could you please update your blog post to add these in case someone had the same problem as me?

@skbolton
Copy link

I think the nixpkgs overlay flake is going to need an update. On a fresh system I was able to install without warnings but most of neorgs functionality is missing so I think it is in a bad state.

@flexagoon
Copy link

The configure script currently doesn't detect lua headers if lua is installed by Homebrew, because they're located in /home/linuxbrew/.linuxbrew/Cellar/lua/5.4.6/include/lua/lua.h

@flexagoon
Copy link

Also, for some reason, it tries to find the headers for lua 5.1, which has been deprecated

@pysan3
Copy link
Contributor

pysan3 commented Mar 26, 2024

@leongjs98 I don't think you have it setup correctly if you need those lines.

@pysan3
Copy link
Contributor

pysan3 commented Mar 26, 2024

@flexagoon You will need lua version 5.1 installed or luajit is even better.

I don't use brew so I'm not sure about the actual package name but if you install it, luarocks build script should be able to pick it up.

FYI lua5.1 is not deprecated or there is a problem with your package manager. You might want to read :h lua-intro for more details.

@morrismuehl
Copy link

@benlubas

I changed my nix config to not use hm, essentially to the snippet that you provided in the manual. Neorg works now (albeit somewhat unreliably), but I am no longer running the nightly version of neovim. If I understood correctly you are running nightly so I don't really understand why. Any idea what the problem is, or where I could look for help?

@vhyrro
Copy link
Member Author

vhyrro commented Apr 3, 2024

@moebiusband73 everything continues to just work if you pin to version 7 and wait for us to resolve the issues :)

The thing is that developers accept to provide a fragile product

This is untrue for many reasons. The most obvious being that we version everything. If the setup is not running on your end, that's lazy deciding not to run the build script, not us. Hence it's not Neorg being fragile. Luarocks isn't something new at all, it has been around for a long while (even during the packer days).

Furthermore, it's far from a one-man show. There are now several dozens of plugins (including basically all of the most popular ones) on luarocks. If my memory serves me right four new ones landed in the mainline repository just yesterday. Those plugins can afford to keep backwards-compatibility, and that's awesome. If Neorg could provide perfect compatibility, it would, but as you can see from the blog posts, it simply can't :p

I understand that things "just working" and ease of use/debugging is of high priority, and that's exactly what I'm working towards with all of this. I'll also be looking at lazy to see if I can make the build logic more consistent (perhaps folke will be kind enough to look into himself, he's the wizard after all). I'm exclusively dedicating developer time to make the whole experience not just on par with what we had before, but better than what we had before. I'll be conjuring up kickstart configurations which get you started with an immediate working version of Neorg as well as guides.

Neorg is not your average "minimal, markdown based note taking tool" Neovim plugin. Testing the limits of what's possible is a part of what we do. Hope that clears things up, feel free to ask about anything if you need further answers :)

@vhyrro
Copy link
Member Author

vhyrro commented Apr 3, 2024

As for everyone else who might be having Neorg problems, sorry, I've been away for the past four days. I'll be looking into all of your issues and making some parts easier to debug. I just made the checkhealth more advanced which is a good start :)

@benlubas
Copy link
Contributor

benlubas commented Apr 3, 2024

@benlubas

I changed my nix config to not use hm, essentially to the snippet that you provided in the manual. Neorg works now (albeit somewhat unreliably), but I am no longer running the nightly version of neovim. If I understood correctly you are running nightly so I don't really understand why. Any idea what the problem is, or where I could look for help?

Yup I'm running nightly, the snippet in the tutorial is slightly simplified from my actual setup. I build nightly from source, I specify the source as an input to my system flake and then pass it as the source to wrapNeovimUnstable. I pin the version of nightly that I'm using b/c the latest version at the time I switched to nightly was crashing so I had to pin. That crash might be resolved if you want to try to build the latest nightly, but I'm not sure.

defining the input
using that input


What do you mean by "somewhat unreliably"?

cc @morrismuehl

@moebiusband73
Copy link

@moebiusband73 everything continues to just work if you pin to version 7 and wait for us to resolve the issues :)

The thing is that developers accept to provide a fragile product

This is untrue for many reasons. The most obvious being that we version everything. If the setup is not running on your end, that's lazy deciding not to run the build script, not us. Hence it's not Neorg being fragile. Luarocks isn't something new at all, it has been around for a long while (even during the packer days).

Furthermore, it's far from a one-man show. There are now several dozens of plugins (including basically all of the most popular ones) on luarocks. If my memory serves me right four new ones landed in the mainline repository just yesterday. Those plugins can afford to keep backwards-compatibility, and that's awesome. If Neorg could provide perfect compatibility, it would, but as you can see from the blog posts, it simply can't :p

I understand that things "just working" and ease of use/debugging is of high priority, and that's exactly what I'm working towards with all of this. I'll also be looking at lazy to see if I can make the build logic more consistent (perhaps folke will be kind enough to look into himself, he's the wizard after all). I'm exclusively dedicating developer time to make the whole experience not just on par with what we had before, but better than what we had before. I'll be conjuring up kickstart configurations which get you started with an immediate working version of Neorg as well as guides.

Neorg is not your average "minimal, markdown based note taking tool" Neovim plugin. Testing the limits of what's possible is a part of what we do. Hope that clears things up, feel free to ask about anything if you need further answers :)

I understood Neorg should be the generic format to support basically any notetaking situation. But why then put it into one probably more and more complex plugin and not split it up. Have a basic plugin with just the essential functionality, and then add other plugins with the more fancy stuff. This would not make users hostage of adding new features they are not interested in.

I am not sure if I am the only one, but I just need a simple note taking format with a robust syntax, good syntax highlighting, linking between notes, good native Telescope integration, and nice conceal support. Thats it, all the other fancy things: Don't need it. So testing the limits of whats possible is not one of my requirements :-). Btw before I used Telekasten which can do most of that. Maybe one can support neorg files there.

So thanks for clarifying, I guess Neorg is just not for me. A pity, I liked the syntax. Maybe I fork it ;-), or is there already a fork with less ambitious aims?

@flexagoon
Copy link

@moebiusband73

AFAIK Neorg is currently undergoing a refactor and migrating to a client-server architecture, so most of the features will be handled by the Norgopolis server, not the nvim plugin. This means it'll be much easier to build whatever plugin you want on top of norg instead of Neorg

@pysan3
Copy link
Contributor

pysan3 commented Apr 3, 2024

@moebiusband73

If you still can't make it to work, paste your error message here.
Let's move towards solving the problem and not waste your time writing long comments.

@morrismuehl
Copy link

morrismuehl commented Apr 5, 2024

@benlubas

Thanks again, I am not using flakes yet but I might look into it if I find the time.

"Unreliably" meant, sometimes it works, sometimes it doesn't. I can execute commands but markup doesn't work and neither does following links.
I can restart nvim and things will probably be fine. Neorg seems to be loaded even if it doesn't work (I can execute neorg commands).

But I am not sure whether that has anything to do with Neorg itself. VimTeX stopped working on me today and all sorts of plugins started misbehaving ever since adopting that config (even just highlighting in *.nix files started becoming super janky). I'll revert to my old config with Neorg 7.0 for now.

@LonelyMusicDisc
Copy link

Has anyone gotten luarocks and by extension Neorg working on Windows? I tried to help my friend install it there, but in the end lua-utils is not found got the best of me and I told him to use 7.0.0 instead.

@vhyrro
Copy link
Member Author

vhyrro commented Apr 5, 2024

@LonelyMusicDisc we've had a decent chunk of windows testers and it should work as expected there. Did your friend have lua installed on their system with something like LuaForWindows as stated in the luarocks.nvim readme?

As always make sure to :Lazy build luarocks.nvim and :Lazy build neorg. I'll try my best to improve the build.lua detection within lazy soon!

@vhyrro
Copy link
Member Author

vhyrro commented Apr 5, 2024

Thanks again, I am not using flakes yet but I might look into it if I find the time.

"Unreliably" meant, sometimes it works, sometimes it doesn't. I can execute commands but markup doesn't work and neither does following links. I can restart nvim and things will probably be fine. Neorg seems to be loaded even if it doesn't work (I can execute neorg commands).

But I am not sure whether that has anything to do with Neorg itself. VimTeX stopped working on me today and all sorts of plugins started misbehaving ever since adopting that config (even just highlighting in *.nix files started becoming super janky). I'll revert to my old config with Neorg 7.0 for now.

@morrismuehl if you're on the latest neovim nightly releases then I have heard that parts of treesitter have started acting up, do note that just in case.

There's nothing in Neorg that can break only sometimes - our checks either fail completely or don't fail whatsoever. If something fails Neorg will be sure to issue a warning or error message, so be sure to check your error logs! Also, make sure you're on the latest stable release of Neorg and run :checkhealth neorg to see if it has any complaints :)

@LonelyMusicDisc
Copy link

So I fixed his install and learned that installing lua-for-windows on scoop does not work the same as installing lua-for-windows normally, do not use scoop!

@vhyrro
Copy link
Member Author

vhyrro commented Apr 5, 2024

Perhaps winget should be officially recommended in our readme, I recall that working when I was doing tests on a VM :)

@tmccombs
Copy link

Is there a way I can use my existing installation of luarocks on my system (archlinux) with lazy.nvim?

Or installing directly with luarocks?

I really don't love the idea of using another plugin that builds a new installation of luarocks when I already have luarocks installed.

And I don't really want to switch to a new package manager either, espeically since rocks.nvim is missiong functionality that lazy.nvim has (such as configuring a plugin to lazily load on certain key mappings or commands, semantic versioning for git repo tags, etc.)

@austinbutler
Copy link
Contributor

What's working for me currently on Nix with home-manager is adding to extraLuaPackages.

  extraLuaPackages = luaPkgs: with luaPkgs; [lua-utils-nvim nvim-nio pathlib-nvim];

Telescope is still half-broken, but I assume that's nvim-neorg/neorg-telescope#57.

@maxdiebold
Copy link

maxdiebold commented Apr 15, 2024

@morrismuehl I was able to get rocks working with home-manager by adding luajit (which is for Lua 5.1) to extraPackages, where I had been using the lua package. The lua package is set to a more recent version by default, but overriding the version would probably work, too, e.g. pkgs.lua.override { version = "5.1" };. The neovim home-manager module adds the necessary wrapper arguments to the binary in a similar fashion to @pysan3's tutorial.

Why do the instructions advise setting lazy to false? I have no issues lazy loading, and I'd rather keep it that way, since I obviously won't be using Neorg for non-norg files.

@pysan3
Copy link
Contributor

pysan3 commented Apr 15, 2024

Credits to @benlubas for the nix section ;)

@maxdiebold If you lazy load, you cannot get command completions on the first try (like :Neorg togg<tab> won't expand to toggle-concealer). And this is the only downside to lazy loading the plugin so if you always enter a norg file with a keybind etc, you won't notice any problem whatsoever.

However, core devs will only support issues that happen with lazy = false so you will need to fix it on your own if you experience a bug with lazy loading (PR is welcome).

@maxdiebold
Copy link

@pysan3 I've found that I can still get the completions on the first try by setting cmd = "Neorg" in Lazy's plugin spec, but I will keep the second point in mind if I run into any issues!

@mikolajpp
Copy link

Nothing in this thread or in any resource I found helped me to install on current Lunar Vim stable (Neovim 0.9.0).
All attempts failed with lua-utils not found error. Eventually, close to giving up, I decided to install Lunar Vim nightly (Neovim 0.10.0). Apparently there is a (better?) support for luarocks and the installation worked with the stock config!

@Anrock
Copy link

Anrock commented Apr 16, 2024

Hey there. I've switched from paq to rocks with neorg 8.4.0.
Now I have this error when launching neovim

E5113: Error while calling lua chunk: ....1/neorg/modules/core/integrations/treesitter/module.lua:53: Unable to load nvim-
treesitter.ts_utils :(
stack traceback:
        [C]: in function 'assert'
        ....1/neorg/modules/core/integrations/treesitter/module.lua:53: in function 'load'
        ...al/share/nvim/rocks/share/lua/5.1/neorg/core/modules.lua:403: in function 'load_module'
        ...al/share/nvim/rocks/share/lua/5.1/neorg/core/modules.lua:335: in function 'load_module'
        ...ock/.local/share/nvim/rocks/share/lua/5.1/neorg/init.lua:152: in function 'org_file_entered'
        ...ock/.local/share/nvim/rocks/share/lua/5.1/neorg/init.lua:69: in function 'setup'

I also dumped nvim-treesitter in favor of rocks-treesitter.nvim. Is neorg still dependent on nvim-treesitter?

@vhyrro
Copy link
Member Author

vhyrro commented Apr 16, 2024

@Anrock hey, yes Neorg still relies on treesitter. That was a huge oversight on my part when making the rocks.nvim install instructions, so sorry for that.

With #1390 this will no longer be the case. I hope to merge that later today, just trying to fix some things in the rocks-binaries repo!

@bdpierce777
Copy link

Ok so I fixed it, it just needs 2 dependancies dependencies = { "luarocks.nvim", "nvim-treesitter/nvim-treesitter" }, Everything works now.

This did the trick for me using the "lazy kickstart"
The "pure luarocks" config seemed really cool...but I couldn't get it working

@arunoruto
Copy link

arunoruto commented May 13, 2024

I currently use nixvim in home-manager to manage my neorg config under nixos, and I always get the following warning:

Warning [neorg]: lua-utils not found. If you're just installing the plugin, ignore this message, when in doubt run `:Lazy build neorg`. If you're not on lazy please rerun the build scripts.

My neorg.nix file looks like this:

{pkgs, ...}: {
  programs.nixvim = {
    plugins = {
      neorg = {
        enable = true;
        modules = {
          "core.defaults".__empty = null;
          "core.concealer" = {
            config = {
              icon_preset = "basic";
            };
          };
          "core.dirman" = {
            config = {
              workspaces = {
                notes = "~/Documents/notes";
              };
              default_workspace = "notes";
            };
          };
        };
      };
    };
    extraLuaPackages = with pkgs.luaPackages; [
      lua-utils-nvim
      nvim-nio
      pathlib-nvim
    ];
  };
}

I followed @austinbutler comment to add the three packages to extraLuaPackages (which is also available in nixvim), but to no avail.

And whenever I am running home-manager switch I get the following warning about treesitter:

warning: Neorg's `core.defaults` module is enabled but `plugins.treesitter` is not.
Treesitter is required when using the `core.defaults`.

Treesitter is for sure enabled and works fine, but something is messed up in nixvim.

@clemenscodes
Copy link

@arunoruto I also use nixvim, did not have any luck either using their plugin option. However, I managed to fix it using the official neorg-overlay instead and adding the overridden plugin manually:

{
  pkgs,
  config,
  lib,
  ...
}: let
  cfg = config.nixvim.neorg;
in
  with lib; {
    options = {
      nixvim = {
        neorg = {
          enable = mkEnableOption "Enable neorg for nixvim" // {default = true;};
        };
      };
    };
    config = mkIf (config.nixvim.enable && cfg.enable) {
      programs = {
        nixvim = {
          extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
          extraConfigLuaPost =
            /*
            lua
            */
            ''
              require("neorg").setup {
                load = {
                  ["core.defaults"] = {}
                }
              }
            '';
        };
      };
    };
  }

@kjkent
Copy link

kjkent commented Jun 1, 2024

First time installing neorg here and I seem to be getting the same issue as a few people in this thread. I followed the instructions for Lazy.nvim and everything appears to install correctly, but every time I start nvim, I get:

Warning [neorg]: lua-utils not found. If you're just installing the plugin, ignore this message, when in
doubt run `:Lazy build neorg`. If you're not on lazy please rerun the build scripts.

:checkhealth neorg reports:

neorg: require("neorg.health").check()

neorg
- Checking configuration...
- OK Empty configuration provided: Neorg will load core.defaults by default.
- Checking existence of dependencies...
- OK Required dependency vhyrro/luarocks found!
- Checking existence of luarocks dependencies...
- ERROR Critical dependency lua-utils.nvim not found! Please run :Lazy build luarocks.nvim and then      :Lazy build neorg! Neorg will refuse to load.

Unfortunately the suggested build commands do not help. I'm running Arch Linux.

@pysan3
Copy link
Contributor

pysan3 commented Jun 3, 2024

@kjkent
Copy link

kjkent commented Jun 4, 2024

luajit and lua51? If so, yes, both installed.

Edit for the sake of it, I just cleared my neorg/luarocks files, followed the tutorial again and it worked? I... I don't know. Perhaps I missed a config = true in the plugin definitions. Thank you for your help regardless @pysan3

@Mourey
Copy link

Mourey commented Jun 6, 2024

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

@clemenscodes
Copy link

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: #1342 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests