question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:438: bad argument #2 to 'format' (number expected, got nil)

See original GitHub issue

hello there!

sorry for the giant issue name. i wanted to make it easy to search for later (anyway i can edit it). and maybe this might be lsp problem itself and not kls (sorry again).

when using :lua vim.lsp.buf.implementation() on a Kotlin interface, the output is: E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:438: bad argument #2 to 'format' (number expected, got nil). the same does not occur when using on a TypeScript interface (with tsserver obviously), and that’s why i am opening the issue here and not at lsp-config codebase.

i am running

  • NVIM v0.6.0-dev+434-g7f93b2ab0
  • kotlin-language-server 4963762 commit

am i missing anything? could anyone help me please?

EDIT 1 My lsp-config:

lua require'lspconfig'.kotlin_language_server.setup{ on_attach = require'completion'.on_attach }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mjlbachcommented, Oct 11, 2021

This is now fixed in neovim

1reaction
fwcdcommented, Oct 11, 2021

From what I can tell, this looks like a bug in the Neovim LSP client rather than a KLS bug. Looking at the corresponding line, it seems as if the client_id is missing. Googling the issue suggests that the problem is having multiple language servers attached to the buffer:

Read more comments on GitHub >

github_iconTop Results From Across the Web

bad argument #3 to 'format' (number expected, got nil) #3384
42: bad argument #3 to 'format' (number expected, got nil)] 06/Feb/2020 09:53:13 [LuaEngine.cpp:12472] WARNING: Script failure ...
Read more >
Lua error: string expected, got nil --- bad argument #2
In your loop where you define questions add a line before "obj.answer =": obj.question = string.format("%s x %s", left, right).
Read more >
Bad argument #2 (number expected, got nil) - Defold Forum
When I run the program, it shows the error: ERROR:SCRIPT: /main/test.script:112: bad argument #2 to 'find_in_string' (number expected, got ...
Read more >
Runtime error Bad argument #-2 - Solar2D Forums
I'm getting this error when I try to use gotoScene Runtime error bad argument #-2 to 'insert' (Proxy expected, got nil) stack traceback:...
Read more >
bad argument #1 to 'cos' (number expected, got nil) - LÖVE
Hello all. Call me stupid, but I now simplified my failure condition to a point where I cant understand the problem at all....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found