Skip to content

bug: "attempt to call field 'lazy_table' (a nil value)" with Lazy.nvim #831

Description

@kzdnk

Error is shown when opening neovim with config provided below. In my regular config, where I have more plugins, this bug is shown only sometimes (I open neovim three times - nothing happens; I open fourth time - it crashes), so maybe it's some kind of race condition? I don't fully understand how lazy loading works in neovim.

I'm not sure whether this bug report belongs here or in Lazy.nvim, but I thought it might be better to start here.

Error message

Error detected while processing BufWinEnter Autocommands for "*":
Error executing lua callback: ...ztof/.local/share/nvim/lazy/LuaSnip/lua/luasnip/init.lua:737: attempt to call field 'lazy_table' (a nil value)
stack traceback:
        ...ztof/.local/share/nvim/lazy/LuaSnip/lua/luasnip/init.lua:737: in main chunk
        [C]: in function 'require'
        ...share/nvim/lazy/LuaSnip/lua/luasnip/loaders/from_lua.lua:27: in main chunk
        [C]: in function 'require'
        ...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:76: in function <...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:75>
Error executing lua callback: .../nvim/lazy/LuaSnip/lua/luasnip/loaders/from_snipmate.lua:1: loop or previous error loading module 'luasnip'
stack traceback:
        [C]: in function 'require'
        .../nvim/lazy/LuaSnip/lua/luasnip/loaders/from_snipmate.lua:1: in main chunk
        [C]: in function 'require'
        ...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:84: in function <...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:83>
Error executing lua callback: ...re/nvim/lazy/LuaSnip/lua/luasnip/loaders/from_vscode.lua:1: loop or previous error loading module 'luasnip'
stack traceback:
        [C]: in function 'require'
        ...re/nvim/lazy/LuaSnip/lua/luasnip/loaders/from_vscode.lua:1: in main chunk
        [C]: in function 'require'
        ...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:92: in function <...ysztof/.local/share/nvim/lazy/LuaSnip/plugin/luasnip.lua:91>

init.lua:

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup({
	{
		"L3MON4D3/LuaSnip",
		build = "make install_jsregexp",
	},
})

Neovim version: v0.8.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions