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

attempt to call field '_fn' (a nil value) #220

Closed
mhanberg opened this issue Nov 13, 2022 · 5 comments · Fixed by #639
Closed

attempt to call field '_fn' (a nil value) #220

mhanberg opened this issue Nov 13, 2022 · 5 comments · Fixed by #639
Labels
bug Something isn't working

Comments

@mhanberg
Copy link

Describe the bug
When I boot neovim, I am usually presented with the following error

Which version of Neovim are you using?

NVIM v0.9.0-dev-305+g9d7dc5062
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/runner/work/neovim/neovim/build/cmake.config -I/Users/runner/work/neovim/neovim/src -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/Users/runner/work/neovim/neovim/build/include
Compiled by [email protected]

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

To Reproduce
Steps to reproduce the behavior:

  1. nvim .
  2. open a file (I opened an elixir file, which may mean that LSP stuff is related)
  3. see error

Expected Behavior

I would expect no error

Screenshots

Screen.Recording.2022-11-13.at.5.07.58.PM.mov

Noice Log
Please include any related errors from the Noice log file. (open with :Noice log)

Noice log
Sun Nov 13 17:05:43 2022
...ite/pack/packer/start/noice.nvim/lua/noice/util/call.lua:135: attempt to call field '_fn' (a nil value)

stack traceback:
[C]: in function 'pcall'
...ite/pack/packer/start/noice.nvim/lua/noice/util/call.lua:140: in function '_fn'
...ite/pack/packer/start/noice.nvim/lua/noice/util/call.lua:135: in function <...ite/pack/packer/start/noice.nvim/lua/noice/util/call.lua:134>
[C]: in function 'xpcall'
...ite/pack/packer/start/noice.nvim/lua/noice/util/call.lua:145: in function 'handler'
...stalls/neovim/nightly/share/nvim/runtime/lua/vim/lsp.lua:1054: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

Config

I have the following in config/nvim/plugin/noice.lua

require("noice").setup {
  cmdline = {
    enabled = true, -- disable if you use native command line UI
    view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
    opts = { buf_options = { filetype = "vim" } }, -- enable syntax highlighting in the cmdline
    icons = {
      ["/"] = { icon = "" },
      ["?"] = { icon = "" },
      [":"] = { icon = ":", firstc = false },
    },
  },
  views = {
    cmdline_popup = {
      position = {
        row = 1,
        col = "50%",
      },
    },
  },
  routes = {
    {
      filter = {
        event = "msg_show",
        kind = "search_count",
      },
      opts = { skip = true },
    },
    {
      filter = {
        event = "msg_show",
        kind = "",
        find = "written",
      },
      opts = { skip = true },
    },
  },
}
@mhanberg mhanberg added the bug Something isn't working label Nov 13, 2022
folke added a commit that referenced this issue Nov 13, 2022
@folke
Copy link
Owner

folke commented Nov 13, 2022

That's really weird. I don't see this error and it really shouldn't happen.

I just pushed an update that should show an error and stacktrace when this happens.

Can you post back the result?

@folke
Copy link
Owner

folke commented Nov 13, 2022

My tests just failed with the error, so I can check the issue :)

https://github.com/folke/noice.nvim/actions/runs/3457164755/jobs/5770414291

@folke folke closed this as completed in 5ff75a5 Nov 13, 2022
@folke
Copy link
Owner

folke commented Nov 13, 2022

I think I just fixed it. It was your lsp sending you a message.

Shoud work fine now

@przepompownia
Copy link

Fixed for me too. It was hard to reproduce on an isolated environment.

@mhanberg
Copy link
Author

Fixed it! Seeing another error now, will open another issue.

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
Development

Successfully merging a pull request may close this issue.

3 participants