Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: checkhealth problem #1412

Closed
3 tasks done
luxcih opened this issue Apr 16, 2024 · 0 comments · Fixed by #1400
Closed
3 tasks done

bug: checkhealth problem #1412

luxcih opened this issue Apr 16, 2024 · 0 comments · Fixed by #1400
Labels
bug Something isn't working

Comments

@luxcih
Copy link

luxcih commented Apr 16, 2024

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.9.5

Operating system/version

Arch Linux 6.8.5

Describe the bug

Like #1371, #1374, and #1405:

lazy: require("lazy.health").check()

- ERROR Failed to run healthcheck for "lazy" plugin. Exception:
  function health#check, line 25
  Vim(eval):E5108: Error executing lua ...cih/.local/share/nvim/lazy/lazy.nvim/lua/lazy/health.lua:29: attempt to index field 'uv' (a nil value)
  stack traceback:
  ...cih/.local/share/nvim/lazy/lazy.nvim/lua/lazy/health.lua:29: in function 'check'
  [string "luaeval()"]:1: in main chunk

This is a :checkhealth problem for lazy.nvim, because when you just bootstrap/install lazy.nvim and not require("lazy") after, it will give an error on :checkhealth unlike the older versions (v10.17.0 and below). This bug is not really a big deal, I know, but this bug wasted my time debugging my Neovim configuration just because I didn't add require("lazy") after bootstraping, and I don't want others to experience the same thing here.

#1374 (comment)

Steps To Reproduce

  1. Bootstrap lazy.nvim (v10.18.0 or above), don't add require("lazy")
  2. Run :checkhealth

Expected Behavior

:checkhealth works fine without any errors.

Repro

-- Define lazy.nvim installation path
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

-- Ensure that lazy.nvim is installed
if not (vim.uv or vim.loop).fs_stat(lazypath) then
    print("Installing lazy.nvim")
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end

-- Add lazy.nvim to runtime path
vim.opt.rtp:prepend(lazypath)

-- Without this, it gives an error on :checkhealth
-- require("lazy")
@luxcih luxcih added the bug Something isn't working label Apr 16, 2024
@folke folke closed this as completed in 481aed7 Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant