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

E5108 error in bufferline.nvim

Open Theyashsawarkar opened this issue 1 year ago • 23 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

i updated the buffer line to the newest version and now i can't open multiple buffers , it throws the below error

E5108: Error executing lua ...cal/nvim-data/lazy/bufferline.nvim/lua/bufferline/ui.lua:119: attempt to call field 'is_list' (a nil value) stack traceback: ...cal/nvim-data/lazy/bufferline.nvim/lua/bufferline/ui.lua:119: in function 'get_component_size' ...cal/nvim-data/lazy/bufferline.nvim/lua/bufferline/ui.lua:480: in function 'func' vim/shared.lua:257: in function 'get_components' .../Local/nvim-data/lazy/bufferline.nvim/lua/bufferline.lua:56: in function <.../Local/nvim-data/lazy/bufferline.nvim/lua/bufferline.lua:54>

What did you expect to happen?

should open the multiple buffers

Config

{ "akinsho/bufferline.nvim", event = "VeryLazy", keys = { { "bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" }, { "bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" }, { "bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" }, { "br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" }, { "bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" }, { "<S-h>", "BufferLineCyclePrev", desc = "Prev Buffer" }, { "<S-l>", "BufferLineCycleNext", desc = "Next Buffer" }, { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, }, opts = { options = { -- stylua: ignore close_command = function(n) require("mini.bufremove").delete(n, false) end, -- stylua: ignore right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end, diagnostics = "nvim_lsp", always_show_bufferline = false, diagnostics_indicator = function(_, , diag) local icons = require("lazyvim.config").icons.diagnostics local ret = (diag.error and icons.Error .. diag.error .. " " or "") .. (diag.warning and icons.Warn .. diag.warning or "") return vim.trim(ret) end, offsets = { { filetype = "neo-tree", text = "Neo-tree", highlight = "Directory", text_align = "left", }, }, }, }, config = function(, opts) require("bufferline").setup(opts) -- Fix bufferline when restoring a session vim.api.nvim_create_autocmd("BufAdd", { callback = function() vim.schedule(function() pcall(nvim_bufferline) end) end, }) end, }

Additional Information

...

commit

73540cb

Theyashsawarkar avatar Apr 22 '24 16:04 Theyashsawarkar

The same thing happened to me I just did "Lazy sync" and I got exactly that error.

JorgeSlime avatar Apr 22 '24 17:04 JorgeSlime

Same thing after updating my plugins with Lazy, tried leaving the barebones setup() with an empty table and still fails

vim.tbl_isarray is deprecated, use vim.isarray instead. :help deprecated                                                                                                                                             
stack traceback:                                                                                                                                                                                                     
        vim/shared.lua: in function 'is_list'                                                                                                                                                                        
        ...al/share/nvim/lazy/bufferline.nvim/lua/bufferline/ui.lua:119: in function 'get_component_size'                                                                                                            
        ...al/share/nvim/lazy/bufferline.nvim/lua/bufferline/ui.lua:652: in function 'tabline'                                                                                                                       
        ...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:74: in function <...local/share/nvim/lazy/bufferline.nvim/lua/bufferline.lua:54>                                                                 
Press ENTER or type command to continue                                                                                                                                                                              
E5108: Error executing lua vim/shared.lua:0: vim.tbl_isarray was renamed to vim.isarray                                                                                                                              
stack traceback:                                                                                                                                                                                                     
        [C]: in function 'error'                                                                                                                                                                                     
        vim/shared.lua: in function 'is_list'                                                                                                                                                                        
        ...al/share/nvim/lazy/bufferline.nvim/lua/bufferline/ui.lua:119: in function 'get_component_size'                                                                                                            
        ...al/share/nvim/lazy/bufferline.nvim/lua/bufferline/ui.lua:652: in function 'tabline'                                                              

luishendrix92 avatar Apr 22 '24 17:04 luishendrix92

Guys, just compile the latest version of neovim,and everything works.

floation-cutie avatar Apr 22 '24 18:04 floation-cutie

Not sure it's the best fix, but I was able to work around this by:

cd ~/.local/share/nvim/lazy/bufferline.nvim/
git checkout tags/v4.5.3 -b temp-fix

ben-bradley avatar Apr 22 '24 18:04 ben-bradley

Thanks @ben-bradley that fixed it for me. Will set myself a reminder to undo that in a few days when it presumably gets fixed in latest stable or whatever. if you don't mind, do you know if I can just rm -rf the ~/.local/share/nvim/lazy/bufferline.nvim/ directory and relaunch nvim to reset it ? or would that break things (I can just mv it first to try)

michaelbutleridt avatar Apr 22 '24 19:04 michaelbutleridt

If you use lazy, I think a nice way to fix this is by going into your lazyvim lockfile and update the bufferline entry to the following commit.

{
  "bufferline.nvim": { "branch": "main", "commit": "f6f00d9ac1a51483ac78418f9e63126119a70709" }
}

Then open lazy and run the restore command to reinstall at that commit.

blakedietz avatar Apr 22 '24 19:04 blakedietz

Guys, just compile the latest version of neovim,and everything works.

Just confirming that the lastest nightly does not show this problem either.

casret avatar Apr 23 '24 01:04 casret

Guys, just compile the latest version of neovim,and everything works.

just want to know how can i change my neovim version smoothly? my current ver is NVIM v0.10.0-dev i'll appreciate that!~

SheepyChan avatar Apr 23 '24 03:04 SheepyChan

just want to know how can i change my neovim version smoothly? my current ver is NVIM v0.10.0-dev i'll appreciate that!~

It's a high learning curve, but I use nix (the package manager) with NixOS and Ubuntu (via Home Manager) with https://github.com/nix-community/neovim-nightly-overlay.

My basic upgrade routine is two commands.

# pull in latest packages
nix flake update

# update nixos
sudo nixos-rebuild --flake ".#$(hostname)" switch

# update ubuntu via home manager
nix run ".#homeConfigurations.$(whoami)@$(hostname).activationPackage" -- build . switch

higherorderfunctor avatar Apr 23 '24 04:04 higherorderfunctor

Guys, just compile the latest version of neovim,and everything works.

Can confirm this works but what about those who installed Neovim by package?

Can you try this out? https://github.com/akinsho/bufferline.nvim/issues/895#issuecomment-2070772951

mikavilpas avatar Apr 23 '24 04:04 mikavilpas

Guys, just compile the latest version of neovim,and everything works.

just want to know how can i change my neovim version smoothly? my current ver is NVIM v0.10.0-dev i'll appreciate that!~

Don't know how you install nvim before, but I personally just use commands below hope this helps.

// sudo add-apt-repository ppa:neovim-ppa/stable    
sudo apt-get update
sudo apt-get install neovim   

floation-cutie avatar Apr 23 '24 06:04 floation-cutie

If you are using packer, you can force to use v4.5.2 until the main version get fixed

use({
  'akinsho/bufferline.nvim', branch = 'v4.5.2',
  requires = 'kyazdani42/nvim-web-devicons',
  after = 'onedark.nvim',
  config = function()
    require('user/plugins/bufferline')
  end,
})

Unfortunately I do not have enough knowledge to help to fix this issue

Anyway thanks for the plugin. I love it.

antonioanerao avatar Apr 23 '24 11:04 antonioanerao

伙计们,只需编译最新版本的 neovim,一切正常。

It works, thanks!

Myxhf avatar Apr 23 '24 12:04 Myxhf

even with rm -rf the plugin and using lazy to pin on v4.5.3, on NVIM v0.10.0-dev-3005+gaf8500af6-Homebrew I still get the errors.

tomspeak avatar Apr 25 '24 16:04 tomspeak

If you use lazy.nvim or LazyVim, use:

  {
    "akinsho/bufferline.nvim",
    branch = "main",
  },

because the latest version v4.5.3 doesn't have the neovim 0.10 fix. It can be removed when a new release includes it.

z11i avatar Apr 26 '24 02:04 z11i

I created a pull request that appears to solve the issue: https://github.com/akinsho/bufferline.nvim/pull/897

It didn't give me this error when using it as a local plugin


        {
            dir= '~/personal/bufferline.nvim',
            version = "*",
...

zegabr avatar Apr 26 '24 02:04 zegabr

Hey everyone, if you're having issues with bufferline.nvim, I've fixed them in my forked repository. You can use it here: [link to your forked repository]

Theyashsawarkar avatar Apr 26 '24 09:04 Theyashsawarkar

Hello everyone,

I've recently submitted a pull request to the bufferline.nvim repository, addressing this issue . I've made the necessary changes and put in the effort to ensure it aligns with the project's standards.

If you encounter similar issues or have been waiting for this improvement, you can check out my forked repository where the fixes are already implemented: https://github.com/Theyashsawarkar/bufferline.nvim

I'm actively monitoring the pull request and any feedback from the maintainers, so feel free to provide your input or suggestions. Let's work together to enhance the project for the entire community.

Thank you for your attention and support.

Theyashsawarkar avatar Apr 26 '24 09:04 Theyashsawarkar

That's the beauty of free/libre software, you can fork whenever you want and use your modified version. That said I think it's waaay too soon to decide not to use this repo anymore!

michaelbutleridt avatar Apr 26 '24 13:04 michaelbutleridt

Also had the same issue.. interesting to see that doing the changes manually to the plugin structure seems to be a common thing? To workaround this issue all I did was:

  {
    "akinsho/bufferline.nvim",
    tag = "v4.5.2", -- this N-1 version seems to be running fine

Not sure about each situation above but some manual actions might not get us the expected result.. running "rm -rf" doesn't clean up file lazy-lock.json and reinstalling bufferline might not bring the desired version, or something similar for other actions..

Try running :Lazy and hitting u (to update) or in the worst case x and i (to reinstall) should be enough

I also updated to the latest nvim nightly as mentioned above but the latest version seems to introduce a more annoying issue to me, it's not showing up the "horiz" char from fillchars.. I guess I'm stuck on version v4.5.2 for now

rodhash avatar Apr 27 '24 22:04 rodhash

That's the beauty of free/libre software, you can fork whenever you want and use your modified version. That said I think it's waaay too soon to decide not to use this repo anymore!

i am not planning on abandaning this repo but rather trying to give a temporary solution , that's all

Theyashsawarkar avatar Apr 28 '24 06:04 Theyashsawarkar

Guys, just compile the latest version of neovim,and everything works.

just want to know how can i change my neovim version smoothly? my current ver is NVIM v0.10.0-dev i'll appreciate that!~

I am in pop!_os, an ubuntu derived linux, here is how I install new nvim versions from the appimage file:

Your Neovim executable is located in `/usr/local/bin`. 
Bash and your hotkey point to that location when you execute nvim. 
The older versions are (or will be) in that folder if you need them for some reason.

To upgrade neovim:

   1. In your terminal, navigate to /usr/local/bin, 
   
   2. Rename your current `nvim` to `nvim_x.xx`, where `x.xx` is the version number of the old neovim:
        `sudo mv nvim ./nvim_x.xx`

    3. Download the latest appimage file from https://github.com/neovim/neovim/releases/nightly to `~/Downloads`

    4. Move the new appimage file from `~/Downloads` to `/usr/local/bin`
        `sudo mv ~/Downloads/nvim.appimage /usr/local/bin/`

    5. Change permissions on the new file
        `sudo chmod u+x nvim.appimage`

    6. Change the name to your prior neovim name (for me it is `nvim`)
        `sudo mv nvim.appimage ./nvim`

    7. That's it, nvim should work as before with all the hotkeys and in bash, etc.

Stanton-B avatar May 02 '24 22:05 Stanton-B

Hey everyone, if you're having issues with bufferline.nvim, I've fixed them in my forked repository. You can use it here: [link to your forked repository]

Hi! Thanks for this quick fix.

For everyone who may be uncomfortable grabbing some random dude's fork of a popular project and running the code on your computer: the changes are minor and do nothing malicious.

hlmtre avatar May 04 '24 00:05 hlmtre

This issue should now be resolved on the latest version of bufferline. It should cover those on 0.9.0 and 0.10.0. I'll close this out now I've merged in fixes and released a new version

akinsho avatar May 20 '24 08:05 akinsho

@akinsho The latest commit still breaks backwards compatibility despite checks for 0.10.0.

I suggest the following change to cover every API.

diff --git a/lua/bufferline/utils/init.lua b/lua/bufferline/utils/init.lua
index fe19eeb..cbac0c9 100644
--- a/lua/bufferline/utils/init.lua
+++ b/lua/bufferline/utils/init.lua
@@ -253,10 +253,7 @@ end
 -- TODO: deprecate this in nvim-0.11 or use strict lists
 --- Determine which list-check function to use
 
-if vim.fn.has("nvim-0.10") == 1 then
-  M.is_list = vim.isarray or vim.islist
-else
-  M.is_list = vim.tbl_isarray or vim.tbl_islist
-end
+-- Backwards compatibility: nvim-0.10 breaking changes
+M.is_list = vim.isarray or vim.islist or vim.tbl_isarray or vim.tbl_islist
 
 return M

Thanks.

@floation-cutie Of course we all can compile new neovim but in some settings automated tests fail and don't run.

hinell avatar May 20 '24 19:05 hinell

@hinell gave your solution a spin, have completely lost tract of which of these methods is available where but just falling back to whatever exists is hopefully enough. Should be available from 73edc1f2732678e7a681e3d3be49782610914f6b onwards

akinsho avatar May 21 '24 16:05 akinsho

@akinsho Works like a charm. Thanks!

hinell avatar May 24 '24 08:05 hinell