wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.75k stars 262 forks source link

E5108: Error executing lua .../packer/start/packer.nvim/lua/packer.lua:692: attempt to index a nil value #570

Open kdheepak opened 2 years ago

kdheepak commented 2 years ago

nvim --version | head -1
NVIM v0.6.0-dev+181-g5d633546b

git --version
git version 2.31.1

MacOSX 10.15

iTerm2

Steps to reproduce

When I run :PackerCompile, I get the following error message:

packer.nvim/lua/packer.lua:692: attempt to index a nil value

It doesn't happen always, although I have the following in my init.lua:

local function reload_config()
  require("plenary.reload").reload_module("kd/plugins/lualine", true)
  vim.cmd("source ~/.config/nvim/init.lua")
  vim.cmd("source ~/.config/nvim/lua/kd/plugins.lua")
  vim.cmd(":PackerCompile")
end

autocmd("BufWritePost", "plugins.lua", reload_config)
wbthomason commented 2 years ago

Sorry for my delayed response (#562) - is this still happening? I suspect it may have been fixed by #572.

kdheepak commented 2 years ago

I haven’t checked in a while, since I removed autoreload. I will try again tonight and report back.

vladdoster commented 2 years ago

This issue stems from neovim v0.6.0.

If you downgrade to v0.5.0 the issue will go away.

See this this issue.

wbthomason commented 2 years ago

@vladdoster Do you have any information about why v0.6.0 causes this issue? This doesn't seem to be the same as e.g. #589.

vladdoster commented 2 years ago

I do not know why v0.6.0 causes it :(

@wbthomason

akinsho commented 2 years ago

There's a breaking changes nvim issue thread and one of the changes on it might be the cause, complete stab in the dark but the behaviour of vim.tbl_extend and vim.tbl_deep_extend has changed which caused me some trouble in one of my plugins 🤷🏿‍♂️

wbthomason commented 2 years ago

@akinsho Do you mean this one? https://github.com/neovim/neovim/issues/14090#issuecomment-882660544

akinsho commented 2 years ago

Yep that's the one 👍🏿 , didn't remotely check to see if that method is used anywhere remotely related to this issue, just a guess since it seems to be 0.6 related

wbthomason commented 2 years ago

What's weird is that @kdheepak reports this only happens intermittently, and I have yet to be able to reproduce it myself. I think that if it was one of those functions, we'd be more likely to see the error on every operation?

@kdheepak: If you still see this, has the line number reported in the error changed at all?

kdheepak commented 2 years ago

I'm not able to reproduce it consistently. I just reenabled this in my configuration and I'm currently not seeing the issue. I'll leave it enabled and let you know if I run into this.

wbthomason commented 2 years ago

Thank you! I think that - pending further reports - this might have been a transient issue with 0.6.0. We'll leave it open for a bit to collect more info, but probably close if we hear nothing new.