"Attempt to index a nil value" after upgrading to `zk` 0.12.0
jfvillablanca opened this issue · 5 comments
Zk seems to work fine yesterday; today I get this error:
I did some basic troubleshooting, remove zk-nvim from my plugins lua config, then reinstalled via packer. The error persists.
I followed the traceback to line 50 of ...zk-nvim/lua/zk/commands/init.lua
I am not sure if the LSP warning is an indication of the error, I'm not confident enough to troubleshoot Lua.
Neovim version: nightly
I'm not sure if relevant but might as well include additional info:
When I synced my plugins, there was a warning about breaking changes from a recent commit of nvim-treesitter. Unfortunately, I failed to record which commit it was, since I was not expecting an error to start my day.
I will continue to troubleshoot to the best of my ability but I am hoping for someone more knowledgeable to take a look
I had the same issue, and for me it was a change in zk
My template was:
# {{env.PROJECT}} {{date now '%Y-%m-%d %H:%M'}}
{{content}}
When running zk new
in the shell, it printed zk: the {{date}} template helper was renamed to {{format-date}}, please update your configuration
and exited without creating a new file.
I changed it to:
# {{env.PROJECT}} {{format-date now '%Y-%m-%d %H:%M'}}
{{content}}
and now everything is working - zk new
in the shell and :ZkNew
in nvim
It worked! Unfortunately, the new format prompt does not appear in nvim and I rarely use the shell version to create new notes, so I never encountered the error. 😅
Thanks @eyemyth
Thank you for chiming in @eyemyth. Sorry for that, I didn't think it would fail in a confusing way with zk-nvim
.
I'll pin this issue to let folks know.
Thanks for posting this. I was having the same issue and needed to update my templates in order to make it work. A couple more symptoms that I was having that I'll leave here for posterity.
- Whenever the faulty template was hit, it was killing the lsp server. So I was no longer getting hints on my links nor able to follow links with go to definition.
- The change also effects filename templates that are included in the config.toml file. i.e.
filename = "{{format-date now}}"