nvim-neotest / neotest-jest

MIT License
121 stars 80 forks source link

E5108: Error executing lua [string ":lua"]:1: attempt to index field 'run' (a nil value) #48

Closed sjdonado closed 1 year ago

sjdonado commented 1 year ago

Not sure what is causing this error. But I cannot run any of the nvim-neotest commands

cw0 commented 1 year ago

In my case, the config function in packer wasn't running. I called it explicitly elsewhere and the errors went away.

sjdonado commented 1 year ago

In my case, the config function in packer wasn't running. I called it explicitly elsewhere and the errors went away.

how you did it?

cw0 commented 1 year ago

I called the following snippet outside of packer's startup function.

require('neotest').setup({
    adapters = {
        require("neotest-jest"),
    },
    output = {
        enable = true,
        open_on_run = true,
    },
})

The section in my packer startup function looks like this now:

  use {
    "nvim-neotest/neotest",
    requires = {
      'nvim-lua/plenary.nvim',
      'nvim-treesitter/nvim-treesitter',
      'antoinemadec/FixCursorHold.nvim',
      'haydenmeade/neotest-jest'
    },
  }
Rimann91 commented 5 months ago

Had the exact same issue with the lazy.nvim manager, I wonder if this can be fixed or if there is a better solution?