DEV Community

Cover image for Migrating To Neovim v0.12.0 Challenge Faced And Solution Found
Kevin Asaria
Kevin Asaria

Posted on

Migrating To Neovim v0.12.0 Challenge Faced And Solution Found

A week ago I saw that there was a new version of Neovim(v0.12.0) out
and I decide to upgrade to it. These are the challenges that I faced
and how I solved it.

Context, as is required nowadays. I use LazyVim to transform the basic neovim to be a capable IDE. And indeed I do not do much configuration cause I have not learnt to and the out of the box experience has served me well. I just install LSPs through mason and so far I have not faced any issue.

I thought that switching to neovim v0.12 would be as easy as downloading the binary , deleting the current one and replacing it with the new one. Easy peasy lemon squeezy.

However, I came across a problem whereby the UI broke and I kept getting this error

E5108: Lua: vim/_core/editor.lua:0: nvim_exec2()[1]..BufReadPost Autocommands for "*": Vim(append):Lua callback: /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:208: /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:391: attempt to call method 'set_timeout' (a nil value)

After perusing through this error message, I guessed that it was an issue to do with treesitter as there was a change made about it in the new version. This article explains more about it. So I installed treesitter on my system using cargo.

However, the UI problem persisted and I was getting a bit frustrated and for a moment turned to explore the code I was interested in on vscode but it was a hard change since my built muscle memory made it feel unusable.

So I went back and looked at the error, I tried reinstalling LazyVim again by replacing the old configs as mentioned in their installation guide but the problem persisted. Loosing patience, I came to the grave realisation that maybe it was time to familiarise myself with vscode. Anyway, it is what everyone uses nowadays.

I decided to make one last shot in finding a solution before bidding my beloved editor good bye. Looking at the error message, I saw a curious path in the error message '/usr/share/nvim/runtime/...' . I decided to delete it. I thought it would get reinstalled back when I reinstalled LazyVim. It wasn't and even the LazyVim installation could not take place. I got the truncated error below when I opened nvim

E5113: Lua chunk: vim/_init_packages.lua:0: module 'vim.uri' not found: no field package.preload['vim.uri']

which led me to this github issue which explained I had to copy my specific neovim version's runtime to the path '/usr/local/share/nvim'. In my case I had to do:

git clone https://github.com/neovim/neovim.git
cd neovim
git checkout v0.12.0
sudo cp -r runtime /usr/local/share/nvim
Enter fullscreen mode Exit fullscreen mode

And now things are working as expected and I can breathe a sigh of relief. As you have seen, it was just a matter of going with my gut feeling in order to fix this issue. I don't think changing versions is as hectic in vscode as in neovim. I know it is as skill issue but if someone like me who is used to getting beaten by software felt so frustrated, I imagine that a less patient user would have already moved on.

Thank you for your time and hope this helped you.

Top comments (0)