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

Error executing vim.schedule lua callback: async.lua:76: The coroutine failed with this message: vim/shared.lua:0: Expected table, got nil #873

Closed
benjaminchristie opened this issue Sep 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@benjaminchristie
Copy link

benjaminchristie commented Sep 7, 2023

Description

This message appears randomly and I often cannot repeat it. It appears when executing the GitSignsUpdate autocmd.

Attached is the traceback from running nvim -V20log, then splitting to a tracked file using vsp:

Executing User Autocommands for "GitSignsUpdate"
autocommand <Lua 321: ~/.config/nvim/plugin/path/to/autocmd.lua>

chdir(/path/to/opened/file)
chdir(/path/to/.config/nvim/plugin/)
chdir(/path/to/opened/file)
Executing: 
           Error executing vim.schedule lua callback: .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:76: The coroutine failed with this message: vim/shared.lua:0: Expected table, got nil
stack traceback:
	[C]: in function 'assert'
	vim/shared.lua: in function 'tbl_isempty'
	...are/nvim/plugged/gitsigns.nvim/lua/gitsigns/diff_int.lua:72: in function 'run_diff'
	...hare/nvim/plugged/gitsigns.nvim/lua/gitsigns/manager.lua:424: in function 'fn'
	...are/nvim/plugged/gitsigns.nvim/lua/gitsigns/debounce.lua:76: in function 'update'
	...share/nvim/plugged/gitsigns.nvim/lua/gitsigns/attach.lua:365: in function 'fn'
	...are/nvim/plugged/gitsigns.nvim/lua/gitsigns/debounce.lua:76: in function 'attach_throttled'
	...share/nvim/plugged/gitsigns.nvim/lua/gitsigns/attach.lua:426: in function <...share/nvim/plugged/gitsigns.nvim/lua/gitsigns/attach.lua:425>
stack traceback:
	[C]: in function 'error'
	.../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:76: in function 'cb'
	.../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:113: in function 'cb'
	.../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:186: in function <.../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:184>

Neovim version

NVIM v0.10.0-dev-1035+g65d337800 \ Build type: Release \ LuaJIT 2.1.1693350652

Operating system and version

Linux 6.4.12-arch1-1

Expected behavior

I expect this error to not occur.

Actual behavior

See attached traceback. Note that after refreshing the file, the traceback does not reappear.

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
  local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
vim.api.nvim_create_autocmd('User', {
    pattern = 'GitSignsUpdate',
    callback = function()
         local branch = vim.b.gitsigns_head
         if branch ~= nil then
              local hunks_tb = gitsigns.get_hunks(vim.api.nvim_get_current_buf())
              if hunks_tb ~= nil then
                   print(vim.inspect(hunks_tb))
              end
         end
    end
})

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. open a tracked file using vsp, pray that this glitch occurs as it seems random

Gitsigns debug messages

No response

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
1 participant