AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.18k stars 240 forks source link

Installing community plugins from the astrocommunity repo triggers treesitter and mason errors with a fresh install of base astronvim #206

Closed krishnakumarg1984 closed 1 year ago

krishnakumarg1984 commented 1 year ago

Checklist

Operating system/version

Ubuntu 22.10

Terminal/GUI

Wezterm

AstroNvim Health

AstroNvim ~

Describe the bug

For a fresh astronvim base install, trying to install any of the community plugins triggers pageful of lua errors with both Mason (first) and treesitter (subsequently).

Error detected while processing /home/krishnakumar/.config/nvim/init.lua:
Failed to run `config` for mason.nvim
.../krishnakumar/.config/nvim/lua/plugins/configs/mason.lua:2: module 'mason' not found:
^Ino field package.preload['mason']
cache_loader: module mason not found
cache_loader_lib: module mason not found
^Ino file './mason.lua'
^Ino file '/home/linuxbrew/.linuxbrew/share/luajit-2.1.0-beta3/mason.lua'
^Ino file '/usr/local/share/lua/5.1/mason.lua'
^Ino file '/usr/local/share/lua/5.1/mason/init.lua'
^Ino file '/home/linuxbrew/.linuxbrew/share/lua/5.1/mason.lua'
^Ino file '/home/linuxbrew/.linuxbrew/share/lua/5.1/mason/init.lua'
^Ino file './mason.so'
^Ino file '/usr/local/lib/lua/5.1/mason.so'
^Ino file '/home/linuxbrew/.linuxbrew/lib/lua/5.1/mason.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
# stacktrace:
  - ~/.config/nvim/lua/plugins/configs/mason.lua:2 _in_ **config**
  - ~/.config/nvim/lua/astronvim/lazy.lua:34
  - ~/.config/nvim/init.lua:8
Failed to source `/home/krishnakumar/.local/share/nvim/lazy/nvim-ts-autotag/plugin/nvim-ts-autotag.vim`
vim/_editor.lua:0: /home/krishnakumar/.config/nvim/init.lua..nvim_exec2() called at /home/krishnakumar/.config/nvim/init.lua:0../home/krishnakuma
r/.local/share/nvim/lazy/nvim-ts-autotag/plugin/nvim-ts-autotag.vim, line 1: Vim(lua):E5108: Error executing lua [string ":lua"]:1: module 'nvim-
ts-autotag' not found:

Steps to Reproduce

  1. Perform a fresh install of astronvim
  2. Create only one user config file in ~/.config/astronvim/lua/user/plugins/community.lua and try to install a community package.
  3. Quit neovim
  4. Remove all neovim data files from the system i.e. rm -rfv ~/.local/share/nvim/ ~/.local/state/nvim/ ~/.cache/nvim/. This is important
  5. Fire up neovim. When it starts installing various plugins etc, it shall give out a mason error (as pasted above) and follows it up with a treesitter-textobjects related error.

Expected behavior

The astronvim user community plugins should work seamlessly with a fresh state of a clean local cache and not produce these errors which run into pages.

Screenshots

image

Additional Context

No response

mehalter commented 1 year ago

Transferring to the correct repository

mehalter commented 1 year ago

Just gonna drop here that I cannot replicate this. Looks like a caching issue

krishnakumarg1984 commented 1 year ago

@mehalter Based on the recent discord chats, can you please remove the cant replicate tag?

mehalter commented 1 year ago

Sure @krishnakumarg1984 . After discussion it was found that this is not an issue in AstroNvim or the AstroCommunity repository and therefore this can be closed as unplanned.

mehalter commented 1 year ago

Opened an issue upstream: https://github.com/folke/lazy.nvim/issues/803

folke commented 1 year ago

What's in this file? krishnakumar/.config/nvim/lua/plugins/configs/mason.lua:2

It seems that you are requiring mason in a spec. That won't work, since lazy doesn't even know yet what mason is.

You can only require plugins and use plugins inside opts, config etc, not anywhere else.

Or after lazy loaded of course

mehalter commented 1 year ago

@folke I have opened an issue on lazy.nvim that replicates this in a more minimal way. Sorry this was brought to your attention in such a messy way

folke commented 1 year ago

Just pushed a fix for lazy.nvim. Will create a new release in a bit.

luxus commented 1 year ago

i heard @folke will join our discord

folke commented 1 year ago

Just joined, but I'm not that active on discord, so probably not the best place to reach me ;)