windwp / nvim-autopairs

autopairs for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File Not Found when install via Packer

pacaunt opened this issue · comments

Description

I installed the module using Packer and the following error occured:

Error detected while processing /Users/host/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...s/host/.config/nvim/lua/core/plugin_config/autopairs.lua:2: module 'nv
im-autopairs' not found:
        no field package.preload['nvim-autopairs']
        no file './nvim-autopairs.lua'
        no file '/usr/local/share/luajit-2.1/nvim-autopairs.lua'
        no file '/usr/local/share/lua/5.1/nvim-autopairs.lua'
        no file '/usr/local/share/lua/5.1/nvim-autopairs/init.lua'
        no file './nvim-autopairs.so'
        no file '/usr/local/lib/lua/5.1/nvim-autopairs.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        ...s/host/.config/nvim/lua/core/plugin_config/autopairs.lua:2: in main chunk
        [C]: in function 'require'
        /Users/host/.config/nvim/lua/core/plugin_config/init.lua:6: in main chunk
        [C]: in function 'require'
        /Users/host/.config/nvim/init.lua:3: in main chunk

Screen Shot 2567-06-08 at 00 45 39
Screen Shot 2567-06-08 at 00 45 50

Mapping bug

1.If you report a bug about indent. Please remember that plugin doesn't do anything about indent.
It just trigger the indent of your vim config so if you have wrong indent config then it will do wrong indent.
You can check by select a block of code and press ==
2. provide result of command :verbose imap <cr>.

Steps to reproduce

No response

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'windwp/nvim-autopairs',
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('nvim-autopairs').setup()
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing nvim-autopairs and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]

Can confirm, cannot import 'nvim-autopairs.completion.cmp' when installed via packer.

packer-compiled shows this infact:

  ["nvim-autopairs"] = {
    config = { "\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" },
    loaded = false,
    needs_bufread = false,
    only_cond = false,
    path = "/Users/j/.local/share/nvim/site/pack/packer/opt/nvim-autopairs",
    url = "https://github.com/windwp/nvim-autopairs"
  },
  ["nvim-cmp"] = {
    loaded = true,
    path = "/Users/j/.local/share/nvim/site/pack/packer/start/nvim-cmp",
    url = "https://github.com/hrsh7th/nvim-cmp"
  },