nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua
Other
7.27k stars 609 forks source link

Nvim-Tree error 126: attempt to index global 'TreeExplorer' (a nil value) #984

Closed ex4722 closed 2 years ago

ex4722 commented 2 years ago

OS Arch Linux 5.16.0-arch1-1

Neovim version NVIM v0.6.1 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include Compiled by runner@fv-az87-780

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

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

null-ls: require("null-ls.health").check()

nvim: health#nvim#check

Configuration

Performance

Remote Plugins

terminal

tmux

nvim-lsp-installer: require("nvim-lsp-installer.health").check()

nvim-lsp-installer report

nvim-treesitter: require("nvim-treesitter.health").check()

Installation

Parser/Features H L F I J

provider: health#provider#check

Clipboard (optional)

Python 2 provider (optional)

Python 3 provider (optional)

Python virtualenv

Ruby provider (optional)

Node.js provider (optional)

Perl provider (optional)

telescope: require("telescope.health").check()

Checking for required plugins

Checking external dependencies

===== Installed extensions =====

Telescope Extension: harpoon

Telescope Extension: media_files

vim.lsp: require("vim.lsp.health").check()

vim.treesitter: require("vim.treesitter.health").check()

Nvim-tree version b1127c5deaca10e570ffbb33b4045b775971aaeb Latest as of Feb 14

Describe the bug Every couple of seconds a giant bloody error message pops up.

To Reproduce Just open any file and wait type a couple of keys

Expected behavior Excepting nothing to happen

Heres a error low

Error executing vim.schedule lua callback: ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663: Error executing lua: ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:664: V
im(lua):E5108: Error executing lua ...packer/start/nvim-tree.lua/lua/nvim-tree/diagnostics.lua:126: attempt to index global 'TreeExplorer' (a nil value)
stack traceback:
        ...packer/start/nvim-tree.lua/lua/nvim-tree/diagnostics.lua:126: in function 'update'
        [string ":lua"]:1: in main chunk
        [C]: in function 'nvim_command'
        ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:664: in function <...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663>
        [C]: in function 'nvim_buf_call'
        ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663: in function 'set'
        ...gAha5a/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:209: in function 'handler'
        /tmp/.mount_vgAha5a/usr/share/nvim/runtime/lua/vim/lsp.lua:735: in function 'cb'
        vim.lua:285: in function <vim.lua:285>
stack traceback:
        [C]: in function 'nvim_command'
        ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:664: in function <...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663>
        [C]: in function 'nvim_buf_call'
        ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663: in function 'set'
        ...gAha5a/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:209: in function 'handler'
        /tmp/.mount_vgAha5a/usr/share/nvim/runtime/lua/vim/lsp.lua:735: in function 'cb'
        vim.lua:285: in function <vim.lua:285>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...nt_vgAha5a/usr/share/nvim/runtime/lua/vim/diagnostic.lua:663: in function 'set'
        ...gAha5a/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:209: in function 'handler'
        /tmp/.mount_vgAha5a/usr/share/nvim/runtime/lua/vim/lsp.lua:735: in function 'cb'
        vim.lua:285: in function <vim.lua:285>
t-troebst commented 2 years ago

Same issue here. I did a git bisect: the issue was introduced in https://github.com/kyazdani42/nvim-tree.lua/commit/6da74679449897dd95eaecaefe8dea80fc7eb3de. The problem disappears once nvim-tree has been opened once.

Edit: See also https://github.com/kyazdani42/nvim-tree.lua/issues/981

venzen commented 2 years ago

Same issue on Ubuntu 18.02 using nvim 0.6.1. After the latest refactoring this diagnostic error fills the screen every few minutes:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:663: Error executing lua: /usr/share/
nvim/runtime/lua/vim/diagnostic.lua:664: Vim(lua):E5108: Error executing lua ...packer/start/nvim-tree.lua/lua/nvim-tree/diagno
stics.lua:126: attempt to index global 'TreeExplorer' (a nil value)

It does seem to stop complaining after opening nvim-tree