wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.74k stars 262 forks source link

Cannot access luarocks module from init.lua #593

Open datwaft opened 2 years ago

datwaft commented 2 years ago

Hello! I am trying to use a luarocks module for my neovim configuration using Lua, but I can't require that luarocks module from my init.lua file.

Steps to reproduce

Here is a minimal reproduction of the bug:

Note: I installed the rock pcre2 using homebrew, so the path may change.

-- init.lua
local packer = require("packer");
local use = packer.use
local use_rocks = packer.use_rocks

packer.startup(function()
    use {"wbthomason/packer.nvim"}
    use_rocks {
        "lrexlib-PCRE2",
        env = {PCRE2_DIR = "/home/linuxbrew/.linuxbrew/Cellar/pcre2/10.37_1"}
    }
end)

local exists, rex = pcall(require, "rex_pcre2")
if exists then
    print(vim.inspect(rex))
else
    print("Cannot find rex_pcre2")
end

Actual behaviour

When opening neovim in the messages area you can see "Cannot find rex_pcre2". If you manually require it using :lua print(vim.inspect(require("rex_pcre2"))) it prints the module.

Expected behaviour

Opening neovim should print the module contents.

packer files

Plugin specification file(s) ```lua -- init.lua local packer = require("packer"); local use = packer.use local use_rocks = packer.use_rocks packer.startup(function() use {"wbthomason/packer.nvim"} use_rocks { "lrexlib-PCRE2", env = {PCRE2_DIR = "/home/linuxbrew/.linuxbrew/Cellar/pcre2/10.37_1"} } end) local exists, rex = pcall(require, "rex_pcre2") if exists then print(vim.inspect(rex)) else print("Cannot find rex_pcre2") end ```
packer log file ```log [ERROR Fri Aug 27 10:36:04 2021 2197194688700] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:2: module 'nvim-treesitter.configs' not found: no field package.preload['nvim-treesitter.configs'] no file './nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file './nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/configs.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' [ERROR Fri Aug 27 10:36:04 2021 2197219220500] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...vim-treesitter-refactor/lua/nvim-treesitter-refactor.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' [ERROR Fri Aug 27 10:36:04 2021 2197268936300] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...eesitter-textobjects/lua/nvim-treesitter-textobjects.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' [ERROR Fri Aug 27 10:36:06 2021 2199215576200] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...m/site/pack/packer/start/nvim-ts-rainbow/lua/rainbow.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' [ERROR Sun Sep 5 16:39:32 2021 13053829436600] ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:799: You must provide a function or table of specifications as the first element of the argument to startup! [ERROR Sun Sep 5 16:39:43 2021 13064165755700] ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:799: You must provide a function or table of specifications as the first element of the argument to startup! [WARN Mon Sep 6 22:03:40 2021 5869480449200] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:548: Potential breaking change in commit 20eae7a of Olical/aniseed/develop [WARN Mon Sep 6 22:14:33 2021 6522948788500] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:548: Potential breaking change in commit 20eae7a of Olical/aniseed [ERROR Tue Sep 7 17:58:28 2021 17797312000700] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...vim-treesitter-refactor/lua/nvim-treesitter-refactor.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Tue Sep 7 17:58:28 2021 17797321907700] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:2: module 'nvim-treesitter.configs' not found: no field package.preload['nvim-treesitter.configs'] no file './nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/configs/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file './nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/configs.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/configs.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Tue Sep 7 17:58:28 2021 17797330652200] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...eesitter-textobjects/lua/nvim-treesitter-textobjects.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Tue Sep 7 17:58:30 2021 17799486110500] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...m/site/pack/packer/start/nvim-ts-rainbow/lua/rainbow.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Thu Sep 9 17:00:39 2021 6244751827500] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:566: attempt to index local 'display_win' (a nil value) [WARN Thu Sep 9 17:02:00 2021 6325505676100] .../site/pack/packer/start/packer.nvim/lua/packer/clean.lua:79: Cleaning cancelled! [ERROR Thu Sep 9 17:02:00 2021 6325506039600] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:566: attempt to index local 'display_win' (a nil value) [ERROR Thu Sep 9 17:02:25 2021 6350763712100] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...r/start/nvim-ts-autotag/lua/nvim-ts-autotag/internal.lua:2: module 'nvim-treesitter.configs' not found: no field package.preload['nvim-treesitter.configs'] no file './nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/configs/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/configs.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/configs/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/configs.lua' no file './nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/configs.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/configs.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Thu Sep 9 17:02:25 2021 6350775104800] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...m/site/pack/packer/start/nvim-ts-rainbow/lua/rainbow.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Thu Sep 9 17:02:25 2021 6350780533800] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...eesitter-textobjects/lua/nvim-treesitter-textobjects.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Thu Sep 9 17:02:25 2021 6350957565400] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...s-context-commentstring/lua/ts_context_commentstring.lua:4: module 'nvim-treesitter' not found: no field package.preload['nvim-treesitter'] no file './nvim-treesitter.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter.lua' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [ERROR Thu Sep 9 17:02:25 2021 6350965368500] .../site/pack/packer/start/packer.nvim/lua/packer/async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):E5108: Error executing lua ...vim-treesitter-refactor/lua/nvim-treesitter-refactor.lua:1: module 'nvim-treesitter.query' not found: no field package.preload['nvim-treesitter.query'] no file './nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/luajit-2.1.0-beta3/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/share/lua/5.1/nvim-treesitter/query/init.lua' no file '~/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query.lua' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-treesitter/query/init.lua' no file '/home/datwaft/.config/nvim.main/lua/nvim-treesitter/query.lua' no file './nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/query.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter/query.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter/query.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20210510/lib/lua/5.1/nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-treesitter.so' [WARN Thu Sep 9 20:02:19 2021 17144539958200] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:607: No plugin selected! [WARN Thu Sep 9 20:02:21 2021 17146317371900] ...ite/pack/packer/start/packer.nvim/lua/packer/display.lua:634: No plugin selected! ```
packer compiled file ```lua -- Automatically generated packer.nvim plugin loader code if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') return end vim.api.nvim_command('packadd packer.nvim') local no_errors, error_msg = pcall(function() local time local profile_info local should_profile = false if should_profile then local hrtime = vim.loop.hrtime profile_info = {} time = function(chunk, start) if start then profile_info[chunk] = hrtime() else profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 end end else time = function(chunk, start) end end local function save_profiles(threshold) local sorted_times = {} for chunk_name, time_taken in pairs(profile_info) do sorted_times[#sorted_times + 1] = {chunk_name, time_taken} end table.sort(sorted_times, function(a, b) return a[2] > b[2] end) local results = {} for i, elem in ipairs(sorted_times) do if not threshold or threshold and elem[2] > threshold then results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' end end _G._packer = _G._packer or {} _G._packer.profile_output = results end time([[Luarocks path setup]], true) local package_path_str = "/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" local install_cpath_pattern = "/home/datwaft/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end if not string.find(package.cpath, install_cpath_pattern, 1, true) then package.cpath = package.cpath .. ';' .. install_cpath_pattern end time([[Luarocks path setup]], false) time([[try_loadstring definition]], true) local function try_loadstring(s, component, name) local success, result = pcall(loadstring(s)) if not success then vim.schedule(function() vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) end) end return result end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { ["packer.nvim"] = { loaded = true, path = "/home/datwaft/.local/share/nvim/site/pack/packer/start/packer.nvim" } } time([[Defining packer_plugins]], false) if should_profile then save_profiles() end end) if not no_errors then vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') end ```
akinsho commented 2 years ago

@datwaft this is less a bug and more a known limitation of this plugins current structure. Currently the packer compiled file which also sets up the luarocks path is not sourced till after the init.lua which is why the rock can't be found.

It's been raised a few times and there are plans for a refactor but in the interim you can solve this by manually loading the compiled file in your init.lua after changing its location

datwaft commented 2 years ago

Thanks! Can you give me an example of how to do that?

akinsho commented 2 years ago

@datwaft haven't got much time atm to put in a proper example, you can have a look at plugins/init.lua in my dotfiles otherwise I've outlined this before in other issues but not got them to hand

datwaft commented 2 years ago

No problem. Thanks!

dppo commented 2 years ago

Is there a solution to this problem ?