nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
16.69k stars 16.61k forks source link

Failed to load the parser for 'lua' for nvim-treesitter #969

Open dogusmiuw opened 3 weeks ago

dogusmiuw commented 3 weeks ago

I am not sure what the problem is about. But I guess it's the nvim-treesitter.

I use Windows 10 Pro. I use the latest version of powershell also the latest version of Neovim. I was just watching the video about kickstart.nvim and I want to run ":e $MYVIMRC". Then the following error showed up.

image

If I press enter after this error, it shows the file content without problem. As you can see:

image

When I open init.lua with neovim, the same error:

image

Well I don't know what the problem is. But can anyone help?

The error message in short:

BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: Failed to load parser for language 'lua': uv_dlopen: C:\Users\dous\AppData\Local\nvim-data\lazy\nvim-treesitter\parser\lua.so is not a valid Win32 application.
proofer commented 3 weeks ago

.so files are runtime libraries that have to be built in an OS-dependent way. Your .so Treesitter libraries are a mismatch to your Windows OS. For more info: https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support, specifically the Troubleshooting section at the end:

  1. Install LLVM(for clang support). Instructions are above.

  2. Make clang the compiler to be used by nvim-treesitter. Put the following line somewhere in your lua config.

require 'nvim-treesitter.install'.compilers = { "clang" }

  1. Reinstall the parsers using :TSUpdate

  2. Install parsers in Neovim via :TSInstall c, :TSInstall cpp

dam9000 commented 3 weeks ago

@proofer when using gcc on windows it will still produce .so libraries. @dogusmiuw This issue appears to be possibly the same as: https://github.com/nvim-lua/kickstart.nvim/issues/904 which was solved by upgrading the gcc version and cleaning all the nvim data folders.

proofer commented 3 weeks ago

@proofer when using gcc on windows it will still produce .so libraries.

Indeed. I edited my comment (while you were composing yours.)

Aside: Thanks for kickstart-modular.nvim, which made it easier for me to use kickstart's ideas to improve my config.

dogusmiuw commented 3 weeks ago

@proofer when using gcc on windows it will still produce .so libraries. @dogusmiuw This issue appears to be possibly the same as: #904 which was solved by upgrading the gcc version and cleaning all the nvim data folders.

thanks for the answer. i will try it and give feedback.