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: No errors shown if loading from dir= fails #1773

Open
4 tasks done
pinpox opened this issue Oct 7, 2024 · 1 comment
Open
4 tasks done

bug: No errors shown if loading from dir= fails #1773

pinpox opened this issue Oct 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pinpox
Copy link

pinpox commented Oct 7, 2024

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • 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.10.1

Operating system/version

Nixos unstable

Describe the bug

When loading a plugin via the dir= directive, there is no error shown if this fails. The plugin will just silently not be there, instead of showing an error message.

Example plugin definition:

	{
		dir = pluginpaths .. "/outline.nvim",
		config = function()
			-- Example mapping to toggle outline
			vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", { desc = "Toggle Outline" })

			require("outline").setup({
				-- Your setup opts here (leave empty to use defaults)
			})
		end,
	},

If for some reason (e.g. a typo) the path in dir= is missing outline.nvim it will just not load the plugin, without showing any errors.

Steps To Reproduce

Try to load non-existent plugin from dir=

Expected Behavior

A error is shown

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
	 { dir = "/does/not/exist" }
  },
})
@pinpox pinpox added the bug Something isn't working label Oct 7, 2024
@Drew-Daniels
Copy link

Drew-Daniels commented Nov 5, 2024

This just got me too. Wasn't until I noticed that I had mistyped the path of a local plugin, that I realized lazy.nvim couldn't find my local package and wasn't throwing an error.

❯ uname -a
Darwin drews-m1-mbp 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 arm64

❯ nvim -v
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info
local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

return require("lazy").setup({
  -- ...
  {
    "Exafunction/codeium.vim",
    event = "BufEnter",
    dir = "~/projects/codeium.vim", -- had typed codeium.vim instead of codeium.nvim
    -- dev = true,
  },
  -- ...
})

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

No branches or pull requests

2 participants