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.72k stars 262 forks source link

packer.nvim tries to remove itself when neovim is opened #1108

Closed ghost closed 1 year ago

ghost commented 1 year ago

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.0/share/nvim"

Run :checkhealth for more info

- `git --version`:

git version 2.33.0

- Operating system/version: `macOS Monterey 12.6`
- Terminal name/version: `kitty 0.26.3 created by Kovid Goyal`

### Steps to reproduce
open neovim with given configuration
### Actual behaviour
packer.nvim tries to remove self, :PackerSync is broken (running results in error `[packer.nvim] [ERROR 17:40:15] async.lua:20: Error in coroutine: ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:630: attempt to index local 'display_win' (a nil value)`)
### Expected behaviour
packer.nvim does not try to remove self, :PackerSync works
### packer files

<details>
<summary>Plugin specification file(s)</summary>

Post or link your plugin specification files here, if you aren't able to provide a minimal
reproducer
https://github.com/amada95/dotfiles/tree/main/nvim
</details>

<details>
<summary>packer log file</summary>

Post the contents of ~/.cache/nvim/packer.nvim.log here

[WARN Mon Oct 24 18:44:02 2022 9314769712666] ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:214: "wbthomason/packer.nvim" is an invalid plugin name! [ERROR Mon Oct 24 18:44:04 2022 9317113092791] .../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:630: attempt to index local 'display_win' (a nil value)


</details>

<details>
<summary>packer compiled file</summary>

Post the contents of `packer_compiled.vim` here
N/A, :PackerCompile fails
</details>
ghost commented 1 year ago

Related issues: #701 #742 (neither fixed the issue for me)

dpvdv commented 1 year ago

I had the same issue and after adding some debugging 'print' statements found that vim.fn.expand() was not working properly, because I had set the wildignore option to an incorrect string. It looks like your wildignore string is not working either.

vim.fn.expand() is used in various places by packer and, in my case, caused continuous warnings that xxx is an invalid plugin name! after it had internally called util.get_plugin_short_name(), which uses the vim.fn.expand() function.

ghost commented 1 year ago

Thank you so much for sharing! It seems like this misconfigured wildignore was the problem, and Packer is now working just fine (after clearing out nvim directories in ~/.cache and ~/.local.

Thanks again, marking as closed! :)