nvim-cmp
nvim-cmp copied to clipboard
Error executing lua: Vim:E976: using Blob as a String, Puppeteer completion
FAQ
- [X] I have checked the FAQ and it didn't resolve my problem.
Issues
- [X] I have checked existing issues and there are no open or closed issues with the same problem.
Neovim Version
NVIM v0.7.0-dev+1151-g9d3370a14
Minimal reproducible config
same as provided minimal config with following addition
require'lspconfig'.tsserver.setup {
capabilities = capabilities
}
Description
neovim throws an error before giving suggestions.
Steps to reproduce
open any .js
or .ts
file in a project where puppeteer
is installed and start typing page.keyboard.press('
Expected behavior
suggestions show without any error.
Actual behavior
suggestions show after throwing the following error.
Error executing vim.schedule lua callback: ...are/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/entry.lua:201: Error executing lua: Vim:E976: using Blob as a String
stack traceback:
[C]: in function 'strdisplaywidth'
...are/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/entry.lua:205: in function <...are/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/entry.lua:201>
[C]: in function 'nvim_buf_call'
...are/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/entry.lua:201: in function 'callback'
...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/cache.lua:36: in function 'get_view'
...packer/opt/nvim-cmp/lua/cmp/view/custom_entries_view.lua:122: in function 'open'
...hare/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/view.lua:110: in function 'open'
...hare/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/core.lua:328: in function 'fn'
...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/async.lua:41: in function <...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/async.lua:39>
stack traceback:
[C]: in function 'nvim_buf_call'
...are/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/entry.lua:201: in function 'callback'
...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/cache.lua:36: in function 'get_view'
...packer/opt/nvim-cmp/lua/cmp/view/custom_entries_view.lua:122: in function 'open'
...hare/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/view.lua:110: in function 'open'
...hare/nvim/site/pack/packer/opt/nvim-cmp/lua/cmp/core.lua:328: in function 'fn'
...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/async.lua:41: in function <...im/site/pack/packer/opt/nvim-cmp/lua/cmp/utils/async.lua:39>
Additional context
gif demonstrating the issue.
this happens with the press
API of puppeteer only.
i.e
page.keyboard.press()
const handle = page.waitForSelector('button');
handle.press()
Thank you for your report. I'll investigate it.
I get something similar for lua files:
Error executing vim.schedule lua callback: Vim:E976: using Blob as a String
stack traceback:
[C]: in function 'strdisplaywidth'
...lar/neovim/0.6.1/share/nvim/runtime/lua/vim/lsp/util.lua:1343: in function '_make_floating_popup_size'
...lar/neovim/0.6.1/share/nvim/runtime/lua/vim/lsp/util.lua:1203: in function 'stylize_markdown'
...te/pack/packer/start/nvim-cmp/lua/cmp/view/docs_view.lua:50: in function 'open'
...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/view.lua:229: in function 'callback'
.../site/pack/packer/start/nvim-cmp/lua/cmp/utils/async.lua:95: in function 'cb'
vim.lua:285: in function <vim.lua:285>
any update on this ?
any update on this?
Also getting this issue and also, when I enter in insert mode for the first time, it delays for 1/2 seconds
Me too, while using it in lua:
Error executing vim.schedule lua callback: Vim:E976: using Blob as a String
stack traceback:
[C]: in function 'strdisplaywidth'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:1508: in function '_make_floating_popup_size'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:1355: in function 'stylize_markdown'
...ocal/share/nvim/lazy/nvim-cmp/lua/cmp/view/docs_view.lua:54: in function 'open'
/home/ls/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:238: in function 'callback'
.../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:111: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Hello! Did you find any solutions? @hrsh7th @Abh15h3k @PetarMetodiev @BitInByte
Hi. Is this issue being worked on ?
Currently i have a hack to hide the error ( not actually fixed the error ).
in window.lua
inside cmp
changed this line
height = height + math.max(1, math.ceil(vim.fn.strdisplaywidth(text) / self.style.width))
to this
local ok, result = pcall(vim.fn.strdisplaywidth, text)
if not ok then result = 0 end
height = height + math.max(1, math.ceil(result / self.style.width))
with this change the error no longer shows. but it is still there. I ultimately resorted to this hack because it was getting very frustrating to have that error come with every keystroke at times.
@hrsh7th Please take a look at the issue.
Edit: I just realized that this will hide the error in some cases only. My current understanding of the issue is that there is some "problem" characters in the text which causes vim.fn.strdisplaywidth to error out.
My hack above fixes this for the doc popup ( I was experiencing this is pyright lsp ) There are other places where the hack can be applied.
Hi. Is this issue being worked on ?
Currently i have a hack to hide the error ( not actually fixed the error ).
in
window.lua
inside cmp changed this lineheight = height + math.max(1, math.ceil(vim.fn.strdisplaywidth(text) / self.style.width))
to thislocal ok, result = pcall(vim.fn.strdisplaywidth, text) if not ok then result = 0 end height = height + math.max(1, math.ceil(result / self.style.width))
with this change the error no longer shows. but it is still there. I ultimately resorted to this hack because it was getting very frustrating to have that error come with every keystroke at times.
@hrsh7th Please take a look at the issue.
Edit: I just realized that this will hide the error in some cases only. My current understanding of the issue is that there is some "problem" characters in the text which causes vim.fn.strdisplaywidth to error out.
My hack above fixes this for the doc popup ( I was experiencing this is pyright lsp ) There are other places where the hack can be applied.
thanks to your solution. I sloved it temporarily.