nvim-neorg / neorg-telescope

Telescope.nvim integration for Neorg
GNU General Public License v3.0
187 stars 24 forks source link

Dependency Error: pysan3/pathlib.nvim is a required dependency #67

Closed svenXY closed 3 months ago

svenXY commented 3 months ago

Hi,

I'm still using neorg v7.0.0 and keep having problems with insert_link. As soon as I use the keymap or call the command, I'm getting the following:

   Error  13:20:16 msg_show.lua_error Error executing Lua callback: ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:71: neorg-telescope Dependency Error: pysan3/pathlib.nvim is a required dependency.
stack traceback:
    [C]: in function 'error'
    ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:71: in function 'generate_links'
    ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:103: in function 'insert_link'
    ...lua/neorg/modules/core/integrations/telescope/module.lua:63: in function 'on_event'
    .../.local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:713: in function 'broadcast_event'
    ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:446: in function <...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:431>
    ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:430: in function 'on_event'
    .../.local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:713: in function 'broadcast_event'
    ...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:286: in function <...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:193>
   Error  13:22:32 msg_show.lua_error Error executing Lua callback: ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:71: neorg-telescope Dependency Error: pysan3/pathlib.nvim is a required dependency.
stack traceback:
    [C]: in function 'error'
    ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:71: in function 'generate_links'
    ...elescope/lua/telescope/_extensions/neorg/insert_link.lua:103: in function 'insert_link'
    ...lua/neorg/modules/core/integrations/telescope/module.lua:63: in function 'on_event'
    .../.local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:713: in function 'broadcast_event'
    ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:446: in function <...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:431>
    ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:430: in function 'on_event'
    .../.local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:713: in function 'broadcast_event'
    ...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:286: in function <...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:193>

I already tried to add the plugin to my config, but to no avail.

Anything I can do about it except migrating to v8?

svenXY commented 3 months ago

my config:

return {
  "nvim-neorg/neorg",
  ft = "norg",
  version = "v7.0.0",
  cmd = { 'Neorg' },
  dependencies = {
    { "nvim-lua/plenary.nvim" },
    {"nvim-treesitter/nvim-treesitter"},
    {"pysan3/pathlib.nvim"}, -- tried it here
    {"nvim-neorg/neorg-telescope"},
  },
  build = ":Neorg sync-parsers",
  config = function()
    require('neorg').setup {
      load = {
        ["core.defaults"] = {},
        ["core.summary"] = {},
        ["core.journal"] = { },
        --[[ ["core.keybinds"] = {}, ]]
        ["core.concealer"] = {
          config = {
            icon_preset = "diamond",
          },
        }, -- Allows for use of icons
        ["core.dirman"] = { -- Manage your directories with Neorg
          config = {
            workspaces = {
              private = "~/neorg/private",
            },
            default_workspace = "private",
            autodetect = true,
            autochdir = true,
          }
        },
        ["core.completion"] = {
          config = {
            engine = "nvim-cmp"
          }
        },
        ["core.integrations.telescope"] = {},
        ["core.keybinds"] = {
          config = {
            hook = function(keybinds)
              keybinds.remap_event("norg", "n", "<leader>nf", "core.integrations.telescope.find_linkable" )
              keybinds.remap_event("norg", "n", "<leader>nw", "core.integrations.telescope.switch_workspace")
              keybinds.remap_event("norg", "i", "<C-i>", "core.integrations.telescope.insert_link")
            end,
          },
        },
      },
    }

    local autocmd = vim.api.nvim_create_autocmd   -- Create autocommand
    local augroup = vim.api.nvim_create_augroup   -- Create autocommand

    augroup('setNorgAutocmds', { clear = true })
    autocmd('BufEnter', {
      group = 'setNorgAutocmds',
      pattern = 'index.norg',
      command = 'set autochdir',
    })
    autocmd('BufRead', {
      group = 'setNorgAutocmds',
      pattern = '*.norg',
      command = 'set foldlevelstart=2 conceallevel=1',
    })
    autocmd('BufLeave', {
      group = 'setNorgAutocmds',
      pattern = 'index.norg',
      command = 'set noautochdir'
    })
  end
}
max397574 commented 3 months ago

actually just adding it as a dependency like every other plugin should work but for some reason it doesn't are you sure it's loaded? because the error indicates it isn't

svenXY commented 3 months ago

:Lazy says it's loaded

max397574 commented 3 months ago

what happens if you do :lua =require"pathlib" on the commandline?

svenXY commented 3 months ago

 Error 13:34:03 msg_show.lua_error require"pathlib" E5108: Error executing lua [string ":lua"]:1: loop or previous error loading module 'pathlib' stack traceback: [C]: in function 'require' [string ":lua"]:1: in main chunk

max397574 commented 3 months ago

do you also get this just after starting neovim? or only if you previously tried to use telescope? I'd expect the latter. If so you should do it without trying telescope first and then you should get a meaningful output.

svenXY commented 3 months ago

 Error 13:36:25 msg_show.lua_error require"pathlib" E5108: Error executing lua ...are/nvim/lazy/pathlib.nvim/lua/pathlib/utils/watcher.lua:23: module 'nio' not found: no field package.preload['nio'] cache_loader: module nio not found cache_loader_lib: module nio not found no file './nio.lua' no file '/Users/Sven.Hergenhahn/dev_other/neovim/.deps/usr/share/luajit-2.1/nio.lua' no file '/usr/local/share/lua/5.1/nio.lua' no file '/usr/local/share/lua/5.1/nio/init.lua' no file '/Users/Sven.Hergenhahn/dev_other/neovim/.deps/usr/share/lua/5.1/nio.lua' no file '/Users/Sven.Hergenhahn/dev_other/neovim/.deps/usr/share/lua/5.1/nio/init.lua' no file './nio.so' no file '/usr/local/lib/lua/5.1/nio.so' no file '/Users/Sven.Hergenhahn/dev_other/neovim/.deps/usr/lib/lua/5.1/nio.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' ...are/nvim/lazy/pathlib.nvim/lua/pathlib/utils/watcher.lua:23: in main chunk [C]: in function 'require' ....local/share/nvim/lazy/pathlib.nvim/lua/pathlib/base.lua:5: in main chunk [C]: in function 'require' ...local/share/nvim/lazy/pathlib.nvim/lua/pathlib/posix.lua:1: in main chunk [C]: at 0x0102a9e134 [C]: in function 'require' [string ":lua"]:1: in main chunk

svenXY commented 3 months ago

NVIM v0.11.0-dev-314+g724d1110b Build type: Release LuaJIT 2.1.1716656478

      System-vimrc-Datei: "$VIM/sysinit.vim"
 Voreinstellung für $VIM: "/Users/me/neovim/share/nvim"
max397574 commented 3 months ago

well that's because a dependency of pathlib is missing add https://github.com/nvim-neotest/nvim-nio and it should work

svenXY commented 3 months ago

yes, it works now, thanks

max397574 commented 3 months ago

Glad I could help

svenXY commented 3 months ago

FWIW, shouldn't this be added to the documentation?

max397574 commented 3 months ago

I don't think so tbh not needed to describe the dependency of a dependency of the repo of which this is just an extension here even more if that only matter if people use an old version of the main repo