-- Output to log file
if config.use_file then
local fp = io.open(config.out_file, "a")
local str = string.format("[%-6s%s] %s: %s\n", nameupper, os.date(), lineinfo, msg)
fp:write(str) -- <-- error thrown here
fp:close()
end
The error message
Failed to run `config` for lsp-zero.nvim
.../.local/share/nvim/lazy/neovim-trunk/lua/log.lua:151: attempt to index local 'fp' (a nil value)
# stacktrace:
- /neovim-trunk/lua/log.lua:151 _in_ **info**
- /neovim-trunk/lua/trunk.lua:28
- ...
If the
config.out_file
's directory doesn't exist, then the plugin throws an error when trying to write the log file.The code
The code is lua/log.lua:151
The error message
The workarounds
config.use_file = false
config.out_file
to some place that exists.