Skip to content

neotest-go can't be loaded #99

@tubzby

Description

@tubzby

I'm using neovim kickstart with my extra neotest.lua:

return {
  'nvim-neotest/neotest',
  dependencies = {
    'nvim-neotest/nvim-nio',
    'nvim-lua/plenary.nvim',
    'nvim-treesitter/nvim-treesitter',
    'antoinemadec/FixCursorHold.nvim',
    'nvim-neotest/neotest-go',
    'rouge8/neotest-rust',
    'nvim-neotest/neotest-plenary',
    'nvim-neotest/neotest-vim-test',
  },
  config = function()
    require('neotest').setup {
      adapters = {
        require 'neotest-go' {
          -- args = { '-count=1', '-timeout=60s' },
        },
        require 'neotest-rust' {
          args = { '--no-capture' },
        },
        require 'neotest-plenary',
        require 'neotest-vim-test' {
          ignore_file_types = { 'python', 'vim', 'lua' },
        },
      },
    }
    vim.keymap.set('n', '<leader>ur', ':Neotest run<CR>', { desc = '[R]un neo test' })
    vim.keymap.set('n', '<leader>uo', ':Neotest output<CR>', { desc = 'show neo test [O]utput' })
    vim.keymap.set('n', '<leader>ua', ':Neotest attach<CR>', { desc = '[A]ttach neo test' })
    vim.keymap.set('n', '<leader>us', ':Neotest stop<CR>', { desc = '[S]top neo test' })
  end,
}

neotest-rust is fine, but neotest-go is not working, with error messages in .local/state/nvim/neotest.log

WARN | 2025-08-17T15:45:00Z+0800 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:186 | CHILD | Error in remote call [string "return require('neotest-go')._generate_positi..."]:1: module 'neotest-go' not found:
	no field package.preload['neotest-go']
	no file './neotest-go.lua'
	no file '/opt/homebrew/share/luajit-2.1/neotest-go.lua'
	no file '/usr/local/share/lua/5.1/neotest-go.lua'
	no file '/usr/local/share/lua/5.1/neotest-go/init.lua'
	no file '/opt/homebrew/share/lua/5.1/neotest-go.lua'
	no file '/opt/homebrew/share/lua/5.1/neotest-go/init.lua'
	no file './neotest-go.so'
	no file '/usr/local/lib/lua/5.1/neotest-go.so'
	no file '/opt/homebrew/lib/lua/5.1/neotest-go.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	[string "return require('neotest-go')._generate_positi..."]:1: in function 'loaded'
	...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:159: in function 'parse_positions_from_string'
	...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:209: in function 'func'
	...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:178: in function <...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:177>
	[C]: in function 'xpcall'
	...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:177: in function <...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:176>

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