Open larsks opened 7 months ago
Hi, thank you for attempting to debug this yourself! The strace file is useful, we can see that Neovim managed to start and even load a bunch of plugins. We can also see that it writes some shada and properly closes the file descriptor, making me think that it's probably shutting down properly instead of crashing.
This is further confirmed by read(0, "", 65421
returning an empty string (meaning we go through this branch? https://github.com/glacambre/firenvim/blob/master/autoload/firenvim.vim#L171 ) and no write(1,
or write(2,
implying neovim exited without emitting messages.
I guess we'll need to check whether messages are properly sent to neovim by the browser. Could you edit the firenvim script (usually ~/.local/share/firenvim/firenvim
) and prepend exec tee /tmp/stdin |
to the line executing neovim as well as append 2>/tmp/stderr | tee /tmp/stdout
at the end?
Then, attempting to run firenvim by clicking on a textarea a couple of times should create /tmp/stdin
, /tmp/stdout
and /tmp/stderr
. Please upload them here :)
With those modifications, in /tmps/stderr
we see a lua error:
Error detected while processing function <lambda>3[1]..OnStdin:
line 30:
E5108: Error executing lua [string "luaeval()"]:1: attempt to index a boolean value
stack traceback:
[string "luaeval()"]:1: in main chunk
stack traceback:
[string "luaeval()"]:1: in main chunk
[string "luaeval()"]:1: in main chunk
That doesn't reproduce when running e.g. nvim --cmd 'let g:started_by_firenvim = v:true'
.
/tmp/stdin
contains:
o���{"newInstance":true,"password":"..."}
And /tmp/stdout
is empty.
In case it's important, I'm using neovim 0.9.5.
Thanks! Stdin looks as expected, but stderr does not. I don't understand where this "attempt to index a boolean value" comes from.
The stack trace being anonymous + the problem coming from luaeval mean that the problem has to be here: https://github.com/glacambre/firenvim/blob/master/autoload/firenvim.vim#L198-L200 . The only indexing happening there is require("firenvim").start_server
, this must mean that somehow require("firenvim")
is returning false.
This can be confirmed by making a dummy lua module that returns false
instead of an object and then attempting to index it, which results in the exact same error message:
E5108: Error executing lua [string "luaeval()"]:1: attempt to index a boolean value
stack traceback:
[string "luaeval()"]:1: in main chunk
So this means that there is a problem with your plugin manager, it is not installing firenvim or loading it properly. I can't help you more than that without seeing your exact config.
Thanks, that was very helpful. I've identified the culprit, but I remain confused. First, the entire configuration is available here. There is a file lua/firenvim.lua
that causes firenvim to crash simply by existing -- the crash happens even when the file is not required
by anything.
Is this some sort of naming conflict?
Is this some sort of naming conflict?
Indeed, if I name it anything else, everything works as expected.
There is a file lua/firenvim.lua that causes firenvim to crash simply by existing
Aha! I guess neovim sees it first in its runtime path and loads it instead of https://github.com/glacambre/firenvim/blob/master/lua/firenvim.lua . Have you been able to use your neovim config (with a file named firenvim.lua) on previous neovim versions? I wonder if the runtime path order changed.
Have you been able to use your neovim config (with a file named firenvim.lua) on previous neovim versions?
No, this was all part of ditching my old init.vim
configuration and moving to a strictly lua-based config. I put all the firenvim config in lua/firenvim.lua
so that I could simply require(firenvim)
, which seemed like an obvious name :).
I think I might be able to at least improve error messages for this problem.
Firenvim was previously working, but now has started reporting "neovim is not responding". I've walked through the troubleshooting guide and I've gotten as far as "Make sure the browser extension can communicate with neovim". In the background page, I see:
When I load a new page in the browser and then run
ps -fe |grep firenvim
in a terminal, I see:But that command exits after a few seconds. If I run
strace -p <pid> -f
on that process before it exits, I see this, which I hope is more useful to you than it is to me (I don't see any obvious errors).My neovim configuration is currently https://github.com/LazyVim/starter, firenvim, and some lsp configuration installed with Mason.