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

Crashing when trying to view an error #17

Open
liamwh opened this issue Sep 13, 2024 · 5 comments
Open

Crashing when trying to view an error #17

liamwh opened this issue Sep 13, 2024 · 5 comments

Comments

@liamwh
Copy link

liamwh commented Sep 13, 2024

Description

   Error  15:11:37 msg_show.lua_error E5108: Error executing lua ...b/.local/share/nvim/lazy/nui.nvim/lua/nui/utils/init.lua:29: Invalid window id: 1000
stack traceback:
	[C]: in function 'nvim_win_get_width'
	...b/.local/share/nvim/lazy/nui.nvim/lua/nui/utils/init.lua:29: in function 'get_window_size'
	....local/share/nvim/lazy/nui.nvim/lua/nui/layout/utils.lua:94: in function 'get_container_info'
	....local/share/nvim/lazy/nui.nvim/lua/nui/layout/utils.lua:161: in function 'update_layout_config'
	...b/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:388: in function 'update_layout'
	...azy/better-ts-errors.nvim/lua/better-ts-errors/popup.lua:25: in function 'show'
	...tter-ts-errors.nvim/lua/better-ts-errors/diagnostics.lua:138: in function 'show'
	...lazy/better-ts-errors.nvim/lua/better-ts-errors/main.lua:31: in function 'toggle'
	...lazy/better-ts-errors.nvim/lua/better-ts-errors/init.lua:11: in function 'toggle'
	[string ":lua"]:1: in main chunk

Steps to reproduce

<leader>dd on an error in a svelte file

Expected behaviour

The UI to show the formatted error

Environment

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1720049189

  • better-ts-errors version: latest
@OlegGulevskyy
Copy link
Owner

Hm, I am not sure how to reproduce it, it looks like an error is coming from nui which is used to show the popup window.
Here is Svelte file on my side
image

Does this happen in a specific project? On all svelte files? Does it happen on any other types of files (react etc)? I don't see a type of file being an issue, since there is no runtime use of the types of files.
You can open this window even in Lua files and it doesn't use TS Server
image

Do you know which Nui version you have installed?

@walker-tx
Copy link

I had the same issue (using LazyVim). I just needed to install the nui package itself:

-- ./lua/plugins/nui.lua
return {
	"MunifTanjim/nui.nvim",
	lazy = true,
}

I guess having it listed as a dependency wasn't enough?

@OlegGulevskyy
Copy link
Owner

Thanks for confirmation!
That's weird that listing it as a dependency is not enough.

I will take a look if I can pinpoint why and if it's the plugin who is doing something wrong or a package manager

@walker-tx
Copy link

walker-tx commented Sep 14, 2024

Okay, so that didn't actually solve the problem completely, it's just intermittent now.

E5108: Error executing lua ...r/.local/share/nvim/lazy/nui.nvim/lua/nui/utils/init.lua:29: Invalid window id: 1000
stack traceback:
        [C]: in function 'nvim_win_get_width'
        ...r/.local/share/nvim/lazy/nui.nvim/lua/nui/utils/init.lua:29: in function 'get_window_size'
        ....local/share/nvim/lazy/nui.nvim/lua/nui/layout/utils.lua:94: in function 'get_container_info'
        ....local/share/nvim/lazy/nui.nvim/lua/nui/layout/utils.lua:161: in function 'update_layout_config'
        ...r/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:388: in function 'update_layout'
        ...azy/better-ts-errors.nvim/lua/better-ts-errors/popup.lua:25: in function 'show'
        ...tter-ts-errors.nvim/lua/better-ts-errors/diagnostics.lua:138: in function 'show'
        ...lazy/better-ts-errors.nvim/lua/better-ts-errors/main.lua:31: in function 'toggle'
        ...lazy/better-ts-errors.nvim/lua/better-ts-errors/init.lua:11: in function 'toggle'
        [string ":lua"]:1: in main chunk

There seems to be similar issues reported:

Looks like Telescope was causing this issue for a bit, but it's been patched it seems:

It may be worthwhile to check and see that what caused their problem is not also causing the issue here.

If it's not an issue w/ this plugin, I'm wondering if @liamwh and I have a similar plugin that's surfacing this issue - one that you don't have?

This is my :Lazy output:

alpha-nvim
better-ts-errors.nvim
catpuccin
cmp-nvim-lsp
cmp-vsnip
lazy.nvim
lspkind-nvim
lualine.nvim
mason-lspconfig.nvim
mason.nvim
mini.comment
mini.pairs
neo-tree.nvim
neodev.nvim
none-ls-extras.nvim
none-ls.nvim
nui.nvim
nvim-cmp
nvim-lspconfig
nvim-surround
nvim-treesitter
nvim-web-devicons
plenary.nvim
schemastore.nvim
tailwind-tools
telescope-ui-select.nvim
telescope.nvim
tokyonight.nvim
vim-vsnip

@Ali-Aref
Copy link

I had the same issue (using LazyVim). I just needed to install the nui package itself:

-- ./lua/plugins/nui.lua
return {
	"MunifTanjim/nui.nvim",
	lazy = true,
}

I guess having it listed as a dependency wasn't enough?

That worked for me. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants