akinsho / bufferline.nvim

A snazzy bufferline for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: attempt to call field 'setup' (a nil value)

vimalk78 opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Perhaps this is not a bug, but an issue in my configuration. But very often I get the below error when i start neovim with bufferline.nvim plugin installed

Failed to run `config` for bufferline.nvim

.../vimalkum/.config/nvim/lua/custom/plugins/bufferline.lua:6: attempt to call field 'setup' (a nil value)

# stacktrace:
  - ~/.config/nvim/lua/custom/plugins/bufferline.lua:6 _in_ **config**
  - init.lua:69

This is the link to my config. https://github.com/vimalk78/kickstart.nvim/blob/my-kickstart.nvim/lua/custom/plugins/bufferline.lua#L5-L7

return {
  'akinsho/bufferline.nvim',
  version = "*",
  dependencies = 'nvim-tree/nvim-web-devicons',
  config = function()
   require('bufferline').setup {
   }
  end
}

What did you expect to happen?

The bufferline plugin should start without error.

Config

return {
  'akinsho/bufferline.nvim',
  version = "*",
  dependencies = 'nvim-tree/nvim-web-devicons',
  config = function()
   require('bufferline').setup {
   }
  end
}

Additional Information

...

commit

No response

may be this is not the place where setup should be called from. I tried calling require("bufferline").setup{} in the init.lua in the lua/custom/plugins folder.
but then i get error

Error detected while processing /home/vimalkum/.config/nvim-kickstart/init.lua:
Failed to load `custom.plugins`

...ack/packer/start/lightline-bufferline/lua/bufferline.lua:1: module 'nvim-web-devicons' not found:
^Ino field package.preload['nvim-web-devicons']
cache_loader: module nvim-web-devicons not found
cache_loader_lib: module nvim-web-devicons not found
^Ino file './nvim-web-devicons.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/nvim-web-devicons.lua'
^Ino file '/usr/local/share/lua/5.1/nvim-web-devicons.lua'
^Ino file '/usr/local/share/lua/5.1/nvim-web-devicons/init.lua'
^Ino file '/usr/share/lua/5.1/nvim-web-devicons.lua'
^Ino file '/usr/share/lua/5.1/nvim-web-devicons/init.lua'
^Ino file './nvim-web-devicons.so'
^Ino file '/usr/local/lib/lua/5.1/nvim-web-devicons.so'
^Ino file '/usr/lib64/lua/5.1/nvim-web-devicons.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - ~/.local/share/nvim/site/pack/packer/start/lightline-bufferline/lua/bufferline.lua:1
  - ~/.config/nvim/lua/custom/plugins/init.lua:47
  - init.lua:69

I tried adding the line require("bufferline").setup{} in teh root init.lua and it seems to fixed the issue. I will observer a bit more and report. will close the bug report if i dont see the issue again.

commented

@vimalk78 so this is almost certainly a configuration issue. setup is probably the most important function in this plugin so if it were broken I'd probably have 50 open issues about that. Also I use that currently so pretty sure it isn't broken. As to what part of your config might be broken, I'm really sorry but I don't have spare time currently to spend on doing more than triaging critical issues so can't help with debugging style issues like this atm. Please try the issue tracker of kickstart or maybe the neovim subreddit

thanks @akinsho, i did not observe this issue again. Thanks for your answer and closing the issue