AstroNvim / AstroNvim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
https://AstroNvim.com
GNU General Public License v3.0
12.66k stars 922 forks source link

Error at startup #2718

Closed assyrus-favolo closed 3 hours ago

assyrus-favolo commented 3 hours ago

Checklist

Operating system/version

Ubuntu 24.04

Terminal/GUI

Windows terminal

AstroNvim Health

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377

Describe the bug

Error detected while processing /root/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /root/.config/nvim/init.lua:7: attempt to index field 'uv' (a nil value)
stack traceback:
        /root/.config/nvim/init.lua:7: in main chunk

Steps to Reproduce

install nvim, install Astronvim, run nvim

Expected behavior

It should start without errors because the docs say that the version of Neovim 0.9.5 is supported

Screenshots

No response

Additional Context

No response

Repro

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "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
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

-- install plugins
local plugins = {
  { "AstroNvim/AstroNvim", import = "astronvim.plugins" },

  -- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here (autocommands, vim.filetype, etc.)

I can start with the minimal init script, but not the one that came with the repository

mehalter commented 3 hours ago

I cannot replicate with the repro.lua file. It looks to be a problem with your user configuration and not in AstroNvim. I would recommend taking a look at the template we provide for getting started: https://github.com/AstroNvim/template

My guess is in the beginning when you are going to bootstrap the Lazy.nvim plugin manager you have a call to vim.uv which is a new name in Neovim v0.10 (previously vim.loop in Neovim <0.10). You probably want that to be (vim.uv or vim.loop) wherever you use it. Here is how we recommend you do it in the AstroNvim template: https://github.com/AstroNvim/template/blob/main/init.lua#L4

assyrus-favolo commented 3 hours ago

So should I just drop that version of init.lua in place of the current default one?

mehalter commented 3 hours ago

sure :) or just fix the bug in your user configuration. I'm not sure what else you are doing in your init.lua file. The template is not part of the AstroNvim source code. It's a recommended starting point. All of the code inside of your ~/.config/nvim folder is considered yours. You also don't have to start with the template at all and could just make your own Neovim configuration with the lazy.nvim plugin manager and add/import the AstroNvim plugin.

assyrus-favolo commented 3 hours ago

Oh, my bad, I had a holdover configuration from another installation, it wasn't the AstroNvim one, scratch all that

assyrus-favolo commented 3 hours ago

Thanks for pointing me in the right track!