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: Can't run fzf-lua #1243

Closed
4 of 6 tasks
OscBacon opened this issue Jun 10, 2024 · 9 comments
Closed
4 of 6 tasks

Bug: Can't run fzf-lua #1243

OscBacon opened this issue Jun 10, 2024 · 9 comments
Labels
invalid This doesn't seem right upstream An issue upstream (neovim, fzf, etc)

Comments

@OscBacon
Copy link

OscBacon commented Jun 10, 2024

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

WSL

Shell

zsh

Neovim version (nvim --version)

NVIM v0.9.5

Fzf version (fzf --version)

0.51.0 (brew)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--ansi --height 100%

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

{
    "ibhagwan/fzf-lua",
    -- optional for icon support
    dependencies = { "nvim-tree/nvim-web-devicons" },
    config = function()
        -- calling `setup` is optional for customization
        require("fzf-lua").setup({ "fzf-vim" })
    end,
},

(Note: using `Lazy.nvim`)

Describe the bug / steps to reproduce

The following error happens when loading vim after adding fzf-lua:

Failed to run `config` for fzf-lua

Vim:Failed to start server: no such file or directory

# stacktrace:
  - /fzf-lua/lua/fzf-lua/init.lua:40
  - ~/.config/nvim/init.lua:191 _in_ **config**
  - ~/.config/nvim/init.lua:75

Note, I get the following error when running in mini.sh:

Error detected while processing /tmp/fzf-lua.tmp/nvim/site/pack/vendor/start/fzf-lua/scripts/init.lua:
E5113: Error while calling lua chunk: Vim:Failed to start server: no such file or directory
stack traceback:
        [C]: in function 'serverstart'
        ...nvim/site/pack/vendor/start/fzf-lua/lua/fzf-lua/init.lua:40: in main chunk
        [C]: in function 'require'
        ...tmp/nvim/site/pack/vendor/start/fzf-lua/scripts/init.lua:8: in main chunk
@OscBacon OscBacon added the bug Something isn't working label Jun 10, 2024
@ibhagwan
Copy link
Owner

ibhagwan commented Jun 10, 2024

This is a similar issue to #1226 and is unrelated to fzf-lua, it seems the that your neovim fails to serverstart, try running the below:

:= pcall(vim.fn.serverstart, "test")

My guess is this would fail with the same error you posted, see the discussion in #1226 maybe you’ll get a lead how to fix it, once serverstart will work fzf-lua will work as well.

@ibhagwan ibhagwan added invalid This doesn't seem right and removed bug Something isn't working labels Jun 10, 2024
@ibhagwan
Copy link
Owner

Check out this comment specifically #1226 (comment) and make sure your runtime path is accessible and can be written into.

@ibhagwan
Copy link
Owner

See neovim/neovim#20865, this is an issue local to your system, solve the runtime dir and make sure := vim.fn.serverstart() works and fzf-lua will work properly.

@Drewtopia
Copy link

I am on MacOS 14.5 and I had manually added export XDG_RUNTIME_DIR=”/run/user/$UID” in my .zshrc which resolved to /run/user/501.

That directory did not exist and I could not figure out a way to create it so I change the export to be
export XDG_RUNTIME_DIR=”$HOME/.cache/” (not sure if that is a good idea or not)

After I did source ~/.zshrc and opened Neovim, all the errors went away and fzf-lua was able to function as expected.

@mirsella
Copy link

xdg is not supported on macos, but ~/Library/Caches/TemporaryItems seems to be good for runtime dir https://stackoverflow.com/questions/14237142/xdg-runtime-dir-on-mac-os-x

for others values: https://stackoverflow.com/questions/3373948/equivalents-of-xdg-config-home-and-xdg-data-home-on-mac-os-x

@Drewtopia
Copy link

Appreciate your reply to this. I will update my export

@txl263
Copy link

txl263 commented Dec 19, 2024

I am on MacOS 14.5 and I had manually added export XDG_RUNTIME_DIR=”/run/user/$UID” in my .zshrc which resolved to /run/user/501.

That directory did not exist and I could not figure out a way to create it so I change the export to be export XDG_RUNTIME_DIR=”$HOME/.cache/” (not sure if that is a good idea or not)

After I did source ~/.zshrc and opened Neovim, all the errors went away and fzf-lua was able to function as expected.

No need for double quotesexport XDG_RUNTIME_DIR=$HOME/.cache/ Otherwise an error will occur.

@Antonio-Bennett
Copy link

Okay figured it out as said above with creating a new runtime dir on my WSL2 platform I did the following;

If you're on WSL2 I think runtime dirs are fucked. Maybe only if you boot with systemd though which I do. Create a new runtime dir to use, I did $HOME/.xdg_runtime then change permissions chmod 0700 ~/.xdg_runtime then set and export the XDG_RUNTIME_DIR env var for whatever shell you use. I use fish so I set this in my ~/.config/fish/config.fish file set -gx XDG_RUNTIME_DIR "$HOME/.xdg_runtime". I then restarted WSL just to be sure and everything works

@RayGuo-ergou
Copy link
Contributor

Maybe only if you boot with systemd though which I do

Yeah I only experienced this when enabled systemd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right upstream An issue upstream (neovim, fzf, etc)
Projects
None yet
Development

No branches or pull requests

7 participants