projekt0n / github-nvim-theme

GitHub's Neovim themes
MIT License
2.08k stars 105 forks source link

[bug] attempt to call field 'nvim_create_augroup' (a nil value) #168

Closed uolot closed 2 years ago

uolot commented 2 years ago

After updating the plugin minutes ago, I'm now getting the following error:

E5108: Error executing lua ...nvim/plugged/github-nvim-theme/lua/github-theme/util.lua:112: attempt to call field 'nvim_create_augroup' (a nil value)
stack traceback:
        ...nvim/plugged/github-nvim-theme/lua/github-theme/util.lua:112: in function 'autocmds'
        ...nvim/plugged/github-nvim-theme/lua/github-theme/util.lua:232: in function 'load'
        ...nvim/plugged/github-nvim-theme/lua/github-theme/init.lua:15: in function 'setup'
        [string ":lua"]:538: in main chunk

I'm using Plug.vim for managing my plugins, and it pulled the following commits:

  * 7946707 refactor: lua autocmds (47 minutes ago)
  * 715c554 BREAKING_CHANGE: set lualine theme with `theme="auto"` (4 hours ago)
  * 7ed3408 docs: LUALINE.md updated (fixed #167) (5 hours ago)

My neovim details:

$  nvim --version
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.6.1/share/nvim"

Run :checkhealth for more info
uolot commented 2 years ago

I can confirm now that the latest commit is the culprit here. After pinning to the previous commit with

Plug 'projekt0n/github-nvim-theme', { 'commit': '715c554' }

the error message doesn't show up anymore.

sabitm commented 2 years ago

neovim nightly needed for nvim_create_augroup to work. So either pinning to previous commit or install neovim nightly to solve the issue

uolot commented 2 years ago

Hey @sabitm thanks for your response. I see you're not a maintainer of this project, so I'd rather wait for a comment from the contributors before migrating to an unstable version of Neovim.

That aside, I have a question to the actual maintainers - @ful1e5 seems to be the main contributor these days and the author of the commit we're discussing. Would you accept a PR with a workaround? My understanding is that all we need is a conditional check for the version of Neovim we're running and then setting the autogroups the old way for line 0.6.x and the new way for 0.7.x, is that correct? If yes, I'm more than happy to contribute.

ful1e5 commented 2 years ago

I reverted 79467077ddcdfb35aff0d03985bdb0c33038d13e from upstream temporarily because It's causing more errors. Hopefully in the future, I will manage to add version checking inside util.autocmds function as @uolot mention. Until then, I leave this issue open.

PRs are welcome.