kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

attempt to call field 'default_capabilities' (a nil value)?

Open matthiasdebernardini opened this issue 3 years ago • 3 comments

OS Ventura 13.1 macOS,

using neovim installed via brew install --HEAD neovim

$ nvim -v
NVIM v0.9.0-dev-522+g174335923-dirty
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-1743359/share/nvim"

Run :checkhealth for more info

and I am getting the error

Error detected while processing /Users/matthiasdebernardini/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /Users/matthiasdebernardini/.config/nvim/init.lua:349: attempt to call field 'default_capabilities' (a nil value)
stack traceback:
        /Users/matthiasdebernardini/.config/nvim/init.lua:349: in main chunk

I copied and pasted the init.lua and ran :PackerInstall and I am not sure what the issue is.

Any tips for troubleshooting this would be great.

matthiasdebernardini avatar Dec 18 '22 04:12 matthiasdebernardini

Could you try commenting out line 348 in your init.lua file:

local capabilities = vim.lsp.protocol.make_client_capabilities()

and set line 349 to:

local capabilities = require('cmp_nvim_lsp').default_capabilities()

I'm curious if for some reason the make_client_capabilties() function is giving you this issue because otherwise its basically the default config given from cmp_nvim_lsp's documentation. Let me know if the same error is present or if this solves it for you.

aw1875 avatar Dec 18 '22 08:12 aw1875

Could you try commenting out line 348 in your init.lua file:

local capabilities = vim.lsp.protocol.make_client_capabilities()

and set line 349 to:

local capabilities = require('cmp_nvim_lsp').default_capabilities()

I'm curious if for some reason the make_client_capabilties() function is giving you this issue because otherwise its basically the default config given from cmp_nvim_lsp's documentation. Let me know if the same error is present or if this solves it for you.

This worked for me, just had to do :PackerSync to make sure cmp-nvim-lsp was updated. Thanks!

amanharwara avatar Dec 18 '22 10:12 amanharwara

I also had that problem (with stable + nightly).

Once I rm -rf ~/.local/share/nvim/, all was good.

Maybe this should be mentioned as something to run as a first step?

benjamin-thomas avatar Dec 18 '22 13:12 benjamin-thomas

Thank you so much! I knew it was an issue like that but couldn't remember where nvim wrote files to. I had an existing nvim setup already. I will make a PR to the readme.

matthiasdebernardini avatar Dec 19 '22 12:12 matthiasdebernardini