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

invalid value (boolean) at index 62 in table for 'concat'

Open winkee01 opened this issue 2 years ago • 1 comments

executing :PackerSync causes error: [packer.nvim] [ERROR 16:41:57] async.lua:20: Error in coroutine: ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:706: invalid value (boolean) at index 62 in table for 'concat'

CleanShot 2022-05-09 at 16 42 05@2x

winkee01 avatar May 09 '22 08:05 winkee01

@winkee01 since you didn't post your packer config, I'm not sure if your problem is the same as I had, but anyway I'll share what worked for me...

I had a similar error when trying to load configuration from one of my packages. I was doing something like:

  use {'projekt0n/github-nvim-theme', config = require("plugins.configs.theme")}

After changing to the code below, it worked again:

  use {'projekt0n/github-nvim-theme', config = function()
      require("plugins.configs.theme")
  end}

As I saw in the documentation the config property expects a string or a function object and if you pass something different you will see an exception similar to the one you posted.

I hope it helps ;)

Diullei avatar May 22 '22 13:05 Diullei

@Diullei thanks that worked. Strange thing is, looking through the docs several times config = { ... } is used, or an outright config = { profile = { enable = true, threshold = 1 } } which would lead us to think that it takes a table, must be some kind of metatable magic happening 😕

craigmac avatar Oct 08 '22 01:10 craigmac

Hi thanks, @Duillei has pointed out the correct solution, you can't pass require()'s result to the config variable because config expects a string/table/funtion, but require() will return a boolean value. I have solved this issue by printing out plugins structure from packer.nvim/lua/packer.lua, just forgot to close the issue.

image

winkee01 avatar Oct 08 '22 02:10 winkee01