Skip to content

Treesitter error on open #1732

Closed
Closed

Description

@chrisolsen

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.

  • 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

When I open nvim I see the following error. I initially saw this when using my kickstart branch, but I still see it when I use this repo.

I have removed any previous nvim data (~/.local/share/ngin, ~/.local/state/nvim, ~/.cache/nvim)

Failed to run `config` for nvim-treesitter

...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/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 '/usr/share/lua/5.1/nvim-treesitter/configs.lua'
        no file '/usr/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/lib/lua/5.1/nvim-treesitter/configs.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'Archlin
        no file './nvim-treesitter.so'
        no file '/usr/local/lib/lua/5.1/nvim-treesitter.so'
        no file '/usr/lib/lua/5.1/nvim-treesitter.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - .config/nvim/init.lua:248

To Reproduce

  1. Start nvim

Desktop

  • OS: Archlinux
  • Terminal: bash 5.3.3

Neovim Version

NVIM v0.11.4
Build type: RelWithDebInfo
LuaJIT 2.1.1753364724

Activity

  1. zedmakesense commented on Sep 29, 2025

    @zedmakesense

    did you check this -

    # stacktrace:
      - .config/nvim/init.lua:248

    line 248 in init.lua?

  2. SetsuikiHyoryu commented on Sep 30, 2025

    @SetsuikiHyoryu

    Run :checkhealth to see if there are any hints.

    Under normal circumstances, nvim-treesitter should have a file like this:

    ~/.local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter/config.lua.

    If it’s missing, you can try reinstalling nvim-treesitter first.

  3. chrisolsen commented on Sep 30, 2025

    @chrisolsen
    Author

    It is there

    [chris@xps ~]$ file .local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter/config.lua
    .local/share/nvim/lazy/nvim-treesitter/lua/nvim-treesitter/config.lua: ASCII text
    

    Here is the :checkhealth output

    nvim-treesitter:                                                            ✅
    
    Requirements ~
    - ✅ OK Neovim was compiled with tree-sitter runtime ABI version 15 (required >=13).
    - ✅ OK tree-sitter-cli 0.25.10 (/home/chris/.local/share/nvim/mason/bin/tree-sitter)
    - ✅ OK node 24.6.0 (/home/chris/.local/share/mise/installs/node/24.6.0/bin/node)
    - ✅ OK tar 1.35.0 (/usr/bin/tar)
    - ✅ OK curl 8.16.0 (/usr/bin/curl)
      curl 8.16.0 (x86_64-pc-linux-gnu) libcurl/8.16.0 OpenSSL/3.5.3 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.67.1 nghttp3/1.12.0
      Release-Date: 2025-09-10
      Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
      Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
    
    OS Info ~
    - sysname: Linux
    - release: 6.16.8-arch3-1
    - machine: x86_64
    - version: #1 SMP PREEMPT_DYNAMIC Mon, 22 Sep 2025 22:08:35 +0000
    ```
    
  4. cedieio commented on Oct 1, 2025

    @cedieio

    Had the same issue, was thinking I had tree sitter on main version.
    #1657 this PR fixed the error pop up on start.

  5. zedmakesense commented on Oct 1, 2025

    @zedmakesense

    The issue is solved right?

  6. asdf8601 commented on Oct 1, 2025

    @asdf8601
    Contributor

    In case it helps, I've just commented on the line that contains the config reference:

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

    Not sure of the implications of this, but at least I don't see that message every time I open a file.

    I've noticed that this happened after updating tree-sitter; not sure what has changed on their side.

  7. asdf8601 commented on Oct 2, 2025

    @asdf8601
    Contributor

    Specifying the branch name as master solves this issue.

    Note: You have to remove the existing installation of treesitter and install it again to clone the right branch.

     {
        -- Highlight, edit, and navigate code
        'nvim-treesitter/nvim-treesitter',
        lazy = false,
        build = ':TSUpdate',
        branch = 'master',  -- NOTE: Use master for backwards compatibility.
        -- NOTE: this causes error on main
        main = 'nvim-treesitter.configs', -- Sets main module to use for opts
        opts = {
          ensure_installed = ensure_installed,
          auto_install = true,
          highlight = {
            enable = true,
            additional_vim_regex_highlighting = { 'ruby' },
          },
          indent = { enable = true, disable = { 'ruby' } },
        },
        -- NOTE: this causes error on main
        config = function(_, opts)
          -- require('config.treesitter').setup(opts)
          require('nvim-treesitter.configs').setup(opts)
        end,
      },
  8. philwhln commented on Oct 16, 2025

    @philwhln

    In this commit, nvim-treesitter renamed configs.lua (plural) to config.lua.

    nvim-treesitter/nvim-treesitter@692b051

    -    main = 'nvim-treesitter.configs', -- Sets main module to use for opts
    +    main = 'nvim-treesitter.config', -- Sets main module to use for opts
  9. guru245 commented on Dec 2, 2025

    @guru245
    Contributor

    The question is why your nvim is looking for the main branch of nvim-treesitter instead of the master branch. Since master is still the default, your nvim should see the default branch unless you specify another one.

  10. captivus commented on Dec 15, 2025

    @captivus

    Lines 941 - 1001 of init.lua in PR #1657 solved this issue for me. (Replaced the code block 941:962 in init.lua)

  11. harrishu888 commented on Dec 18, 2025

    @harrishu888

    Yes, it is just the require("lazy)

    https://github.com/chrisolsen/kickstart.nvim/blob/master/init.lua#L248

    Yep,
    { -- Highlight, edit, and navigate code
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
    lazy = true, -- just here
    main = "nvim-treesitter.configs", -- Sets main module to use for opts
    -- [[ Configure Treesitter ]] See :help nvim-treesitter
    opts = {
    ensure_installed = {
    "bash",
    "c",
    "diff",
    "html",
    "lua",
    "luadoc",
    "markdown",
    "markdown_inline",
    "query",
    "vim",
    "vimdoc",
    },
    -- Autoinstall languages that are not installed
    auto_install = true,
    highlight = {
    enable = true,
    -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
    -- If you are experiencing weird indenting issues, add the language to
    -- the list of additional_vim_regex_highlighting and disabled languages for indent.
    additional_vim_regex_highlighting = { "ruby" },
    },
    indent = { enable = true, disable = { "ruby" } },
    },
    -- There are additional nvim-treesitter modules that you can use to interact
    -- with nvim-treesitter. You should go explore a few and see what interests you:
    --
    -- - Incremental selection: Included, see :help nvim-treesitter-incremental-selection-mod
    -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
    -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
    },

  12. RebelMoogle commented on Jan 3, 2026

    @RebelMoogle

    The question is why your nvim is looking for the main branch of nvim-treesitter instead of the master branch. Since master is still the default, your nvim should see the default branch unless you specify another one.

    master is no longer the default, the default has been switched to main 3 weeks ago: nvim-treesitter/nvim-treesitter@d3218d9

  13. eamonburns commented on Mar 6, 2026

    @eamonburns

    @chrisolsen - I believe that this is no longer an issue in the latest version of kickstart.nvim

    It looks like your fork (https://github.com/chrisolsen/kickstart.nvim#) is behind, so this should be fixed by updating it.

    Specifically, look at the changes done to the nvim-treesitter plugin spec in init.lua:

    chrisolsen/kickstart.nvim@master...nvim-lua:kickstart.nvim:master#diff-0fc5c43f6f1d7605fd7d16c088ba6b83f096eee8e2049517407bbaa27aa3a4f7R873-R904

  14. oriori1703 commented on Mar 10, 2026

    @oriori1703
    Collaborator

    @eamonburns seems correct.
    Please reopen the issue if the issue persists after updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions