kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

Failed to run 'config' for nvim-treesitter

Open steve0613 opened this issue 11 months ago • 9 comments

Before Reporting an Issue

  • I have read the kickstart.nvim README.md.

  • I have read the appropriate plugin's documentation.

  • I have searched that this issue has not been reported before.

  • [ X ] By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.

Describe the bug

..local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:387: module 'nvim-treesitter.configs' not found: no field package preload[' nvim-treesitter.configs'] cache_loader: module 'nvim-treesitter.configs' not found cache_loader_lib: module 'nvim-treesitter.configs' not found no file './nvim-treesitter/configs.lua' no file '/usr/local/share/luajit-2.1/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs.lua' no file '/usr/local/share/lua/5.1/nvim-treesitter/configs/init.lua' no file './nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter/configs.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './nvim-treesitter.so' no file '/usr/local/lib/lua/5.1/nvim-treesitter.so' no file /usr/local/lib/lua/5.1/loadall.so'

stacktrace:

  • .config/nvim/lua/lazy-plugins.lua:15
  • .config/nvim/init.lua:106

To Reproduce

  1. This occurs the first time you run nvim and each time thereafter. In my research I think there was an update to tree sitter and syntax has changed in the way that it is initialized but I could never figure it out.

Desktop

  • OS: macOS Tahoe 26.2
  • Terminal: Apple's system terminal

Neovim Version

NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1765228720

Image

steve0613 avatar Dec 21 '25 18:12 steve0613

take a look at #1657

akaJuliaan avatar Dec 21 '25 21:12 akaJuliaan

Duplicate of #1732

hippietrail avatar Dec 21 '25 22:12 hippietrail

Just change the following line in your ~/.config/nvim/init.lua file.

main = 'nvim-treesitter.configs', -- Sets main module to use for opts

to

    main = 'nvim-treesitter.config', -- Sets main module to use for opts

This helped me solve this issue.

hemanthkotaprolu avatar Dec 24 '25 17:12 hemanthkotaprolu

It would be fixed by changing in ~/.config/nvim/init.lua

main = 'nvim-treesitter.configs'

To

main = 'nvim-treesitter'

cod3mas0n avatar Dec 26 '25 08:12 cod3mas0n

The problem is that nvim-treesitter has finally switched to the main branch as default which is a complete incompatible rewrite here: https://github.com/nvim-treesitter/nvim-treesitter/commit/d3218d988f72ed34414959c9ccd802d393432d6e

This repo has a configuration for the now legacy master branch of nvim-treesitter.

You can either change your config to adapt tot he main branch or just specify that you want to use the master branch by adding:

  { 
    'nvim-treesitter/nvim-treesitter',
    branch = 'master',
    ...

carloscalla avatar Jan 01 '26 20:01 carloscalla

At least for me, this is the most efficient and effective solution. The previous methods (like changing .configs to .config) only suppress the error messages, but Treesitter doesn't actually function properly. For the fastest fix that actually works, just add branch = 'master'

The problem is that nvim-treesitter has finally switched to the main branch as default which is a complete incompatible rewrite here: nvim-treesitter/nvim-treesitter@d3218d9

This repo has a configuration for the now legacy master branch of nvim-treesitter.

You can either change your config to adapt tot he main branch or just specify that you want to use the master branch by adding:

{ 'nvim-treesitter/nvim-treesitter', branch = 'master', ...

oranshea avatar Jan 03 '26 15:01 oranshea

the problem seems to be kickstart.nvim using older ways to setup treesitter, the treesitter repo has received major updates due to which the entire configuration method has changed, I personally use this setup(it works with lazy.nvim):

return {
    "nvim-treesitter/nvim-treesitter",
    lazy = false,
    build = ":TSUpdate",
    config = function()
        require('nvim-treesitter').install({
            'c', 'lua', 'javascript', 'typescript', 'python', 'go', 'java', 'vim', 'vimdoc'
        })

        vim.api.nvim_create_autocmd('FileType', {
            pattern = { 'c', 'lua', 'javascript', 'typescript', 'python', 'go', 'java' },
            callback = function() vim.treesitter.start() end,
        })
    end
}

Hope this helps out anyone having problem with treesitter in general.

EzpieCo avatar Jan 23 '26 15:01 EzpieCo

It would be fixed by changing in ~/.config/nvim/init.lua

main = 'nvim-treesitter.configs'

To

main = 'nvim-treesitter'

Thank you.

BenjaminThomas1999 avatar Jan 27 '26 17:01 BenjaminThomas1999

This has been fixed in the recent changes. Thanks for the help :)

oriori1703 avatar Feb 28 '26 11:02 oriori1703