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: obisdiain.nvim failed to start after update lazy.nvim to 9.8.1 #543

Closed
3 tasks done
linnovs opened this issue Feb 15, 2023 · 11 comments · Fixed by #549
Closed
3 tasks done

bug: obisdiain.nvim failed to start after update lazy.nvim to 9.8.1 #543

linnovs opened this issue Feb 15, 2023 · 11 comments · Fixed by #549
Labels
bug Something isn't working

Comments

@linnovs
Copy link

linnovs commented Feb 15, 2023

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)

NVIM v0.8.3

Operating system/version

fedora 37

Describe the bug

After update lazy.nvim to 9.8.1, the obisdian.nvim plugin failed to load.

Steps To Reproduce

  1. install obisdian.nvim plugin
  2. update lazy.nvim to 9.8.1
  3. run :ObsidianQuickSwitch

Expected Behavior

Should run normally.

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
	"epwalsh/obsidian.nvim",
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
vim.cmd([[ObisdianQuickSwitch]])
@linnovs linnovs added the bug Something isn't working label Feb 15, 2023
@max397574
Copy link
Contributor

as far as I can tell by looking at the plugins readme and source code you need to call the setup function to get the commands

@folke
Copy link
Owner

folke commented Feb 15, 2023

Exactly, don't just post an issue here. Lazy is just a plugin manager. You need to do your own debugging if a plugin doesn't work.

Also, your repro doesn't work at all. Missing all the deps.

@folke folke closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2023
@infinite-ops
Copy link

I seem to have some issue with obsidian, rolling back to v9.8.0 it works fine, forward to v9.8.1 it breaks and same on head.

Last working commit is 6351a2e, updating to 17a3c3a it breaks.

Not sure if this helps at all. I'm using v0.9.0-dev-969+gec782211f

Failed to run `config` for obsidian.nvim

...ocal/share/nvim/lazy/obsidian.nvim/lua/obsidian/yaml.lua:1: module '../deps/lua_yaml/yaml' not found:
^Ino field package.preload['../deps/lua_yaml/yaml']module ../deps/lua_yaml/yaml not foundmodule ../deps/lua_yaml/yaml not found
^Ino file './///deps/lua_yaml/yaml.lua'
^Ino file '/home/user/git/neovim/.deps/usr/share/luajit-2.1.0-beta3////deps/lua_yaml/yaml.lua'
^Ino file '/usr/local/share/lua/5.1////deps/lua_yaml/yaml.lua'
^Ino file '/usr/local/share/lua/5.1////deps/lua_yaml/yaml/init.lua'
^Ino file '/home/user/git/neovim/.deps/usr/share/lua/5.1////deps/lua_yaml/yaml.lua'
^Ino file '/home/user/git/neovim/.deps/usr/share/lua/5.1////deps/lua_yaml/yaml/init.lua'
^Ino file './///deps/lua_yaml/yaml.so'
^Ino file '/usr/local/lib/lua/5.1////deps/lua_yaml/yaml.so'
^Ino file '/home/user/git/neovim/.deps/usr/lib/lua/5.1////deps/lua_yaml/yaml.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file './.so'
^Ino file '/usr/local/lib/lua/5.1/.so'
^Ino file '/home/user/git/neovim/.deps/usr/lib/lua/5.1/.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - /obsidian.nvim/lua/obsidian/yaml.lua:1
  - /obsidian.nvim/lua/obsidian/note.lua:2
  - /obsidian.nvim/lua/obsidian/init.lua:10
  - ~/.config/nvim/lua/plugins/_obsidian.lua:1
  - ~/.config/nvim/lua/core/_plugins.lua:305 _in_ **config**
  - ~/.config/nvim/lua/core/_lazy.lua:3
  - ~/.config/nvim/lua/core/init.lua:46
  - ~/git/user/admin/configs/dotfiles/nvim/init.lua:1
Failed to source `/home/user/.local/share/nvim/lazy/obsidian.nvim/after/plugin/cmp_obsidian.lua`

...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:433: /home/user/git/user/admin/configs/dotfiles/nvim/init.lua..nvim_exec() called at /home/user/git/user/admin/configs/dotfiles/nvim/init.lua:0../home/user/.local/share/nvim/lazy/obsidian.nvim/after/plugin/cmp_obsidian.lua: Vim(source):E5113: Error while calling lua chunk: ...local/share/nvim/lazy/obsidian.nvim/lua/cmp_obsidian.lua:2: loop or previous error loading module 'obsidian'
stack traceback:
^I[C]: in function 'require'
^I...local/share/nvim/lazy/obsidian.nvim/lua/cmp_obsidian.lua:2: in main chunk
^I[C]: in function 'require'
^I...re/nvim/lazy/obsidian.nvim/after/plugin/cmp_obsidian.lua:1: in main chunk
^I[C]: in function 'cmd'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:433: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:432>
^I[C]: in function 'xpcall'
^I.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:110: in function 'try'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:432: in function 'source'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:391: in function 'source_runtime'

@folke folke reopened this Feb 15, 2023
@folke
Copy link
Owner

folke commented Feb 15, 2023

I think I know what caused this. I just fixed a bug related to loading lua libs. Can you see if the latest lazy version fixes this?

@infinite-ops
Copy link

Using 4a0857c currently and still have the issue :/

@folke
Copy link
Owner

folke commented Feb 15, 2023

Found the issue. Will fix

@folke
Copy link
Owner

folke commented Feb 15, 2023

So there's actually a bug in obsidian: https://github.com/epwalsh/obsidian.nvim/blob/3d459708c77f9ce7ae7165dda07812e685f30d61/lua/obsidian/yaml.lua#L1

Relative paths as module names are not valid. However, before my latest changes this would have worked.

I'll add a hack to lazy for now, but that bug should defintely be fixed in obsidian

@folke folke closed this as completed in e916f41 Feb 15, 2023
@folke
Copy link
Owner

folke commented Feb 15, 2023

Just pushed an update with a hack to work-around that. Basically how it was before, but again, that obsidian code is just very wrong.

@infinite-ops
Copy link

I don't get this quality of service from paid products! Confirmed that fixes it! I'll go raise a bug over in the obsidian module. Thank you @folke

@folke
Copy link
Owner

folke commented Feb 15, 2023

I just submitted an issue there. That require makes no sense :)

epwalsh/obsidian.nvim#93

@gplusplus314
Copy link

Thanks a bunch, @folke . I ran into this yesterday and then it magically started working again after doing an update. I had no idea you glued a hack into place; if you didn't make that issue, I'm not sure how long it would have taken for any of us to notice! 😆

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.

5 participants