zaldih / themery.nvim

A colorscheme picker with live preview and persistence for neovim ✨
https://imzaldih.com/en/post/how-to-change-neovim-colorscheme-with-themery/
GNU General Public License v3.0
200 stars 8 forks source link

"Failed to run `config` for themery.nvim..." error on NVIM startup #37

Open joehdodd opened 2 weeks ago

joehdodd commented 2 weeks ago

Hi All,

I am intermittently getting an error from Themery when starting NVIM.

Failed to run `config` for themery.nvim

.../share/nvim/lazy/themery.nvim/lua/themery/controller.lua:21: bad argument #1 to 'pairs' (table expected, got nil)

# stacktrace:
  - /themery.nvim/lua/themery/controller.lua:21 _in_ **loadActualThemeConfig**
  - /themery.nvim/lua/themery/controller.lua:229 _in_ **bootstrap**
  - /themery.nvim/lua/themery/init.lua:7
  - .config/nvim/lua/custom/plugins/themery.lua:5 _in_ **config**
  - .config/nvim/init.lua:230

When that error shows during startup, I also get the following error when trying to run Themery/change colorschemes:

E5108: Error executing lua [string ":lua"]:1: loop or previous error loading module 'themery'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

My config is as follows:

return {
  'zaldih/themery.nvim',
  lazy = false,
  config = function()
    require('themery').setup {
      themes = {
        { colorscheme = 'catppuccin-macchiato', name = 'Catppuccin Macchiato' },
        { colorscheme = 'catppuccin-frappe', name = 'Catppuccin Frappe' },
        { colorscheme = 'catppuccin-latte', name = 'Catppuccin Latte' },
        { colorscheme = 'tokyonight-storm', name = 'TokyoNight Storm' },
        { colorscheme = 'tokyonight-day', name = 'TokyoNight Day' },
      },
      livePreview = true,
    }
  end,
  keys = {
    { '<leader>tc', ':Themery<CR>', desc = 'Toggle Colorschemes' },
  },
}

Is my config incorrect?

PlexSheep commented 1 week ago

I have the same problem, but only when I actually try to use the plugin.