folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
14.32k stars 344 forks source link

bug: #668

Closed thepenguinthatwants closed 1 year ago

thepenguinthatwants commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.8.3

Operating system/version

arch linux

Describe the bug

Error detected while processing User Autocommands for "VeryLazy":
Failed loading config.autocmds
...ocal/share/nvim/lazy/LazyVim/lua/lazyvim/config/init.lua:131: module 'config.autocmds' not found:
^Ino field package.preload['config.autocmds']
cache_loader: module config.autocmds not found
cache_loader_lib: module config.autocmds not found
^Ino file './config/autocmds.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/config/autocmds.lua'
^Ino file '/usr/local/share/lua/5.1/config/autocmds.lua'
^Ino file '/usr/local/share/lua/5.1/config/autocmds/init.lua'
^Ino file '/usr/share/lua/5.1/config/autocmds.lua'
^Ino file '/usr/share/lua/5.1/config/autocmds/init.lua'
^Ino file './config/autocmds.so'
^Ino file '/usr/local/lib/lua/5.1/config/autocmds.so'
^Ino file '/usr/lib/lua/5.1/config/autocmds.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file './config.so'
^Ino file '/usr/local/lib/lua/5.1/config.so'
^Ino file '/usr/lib/lua/5.1/config.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
# stacktrace:
  - /LazyVim/lua/lazyvim/config/init.lua:131
  - /LazyVim/lua/lazyvim/config/init.lua:130 _in_ **_load**
  - /LazyVim/lua/lazyvim/config/init.lua:146 _in_ **load**

Steps To Reproduce

Updated plugins and saw this issue. Doesn't seem to be caused by other plugins etc.

Expected Behavior

Being clean without this error. I can be fine when restoring to earlier lazy-lock.json state and using restore.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
folke commented 1 year ago

I made some changes to the lua-loader in lazy.nvim, and forgot to make the relevant changes in LazyVim. Just fixed it there.

Will make a new release in a bit

krishnakumarg1984 commented 1 year ago

@folke It looks like this issue might not be fully solved. I have just faced this issue with AstroNvim when adding community repos, and discussed it in their discord channel.

The maintainers of AstroNvim have tested it out and concluded that there exists a bug somewhere in the lazy.nvim cache_loader stuff. I have no idea how to come with a minimum reproducible for this bug, so I am literally linking it to the relevant issue in the AstroNvim repo: https://github.com/AstroNvim/astrocommunity/issues/206, and the relevant lines from the chat log/transcript on their discord discussion here: https://discord.com/channels/939594913560031363/942007419050029086/1108413031643349073

Apologies upfront that I couldn't hone the bug report into a minimal example.

mehalter commented 1 year ago

Sorry for the comment above, I believe this is a different issue probably and only related because the cache_loader is having some issues. I have opened an appropriate issue #803