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

Unable to execute request due to missing method getinfo_effective_method (v2)

Open hlidotbe opened this issue 1 year ago • 3 comments

It's probably linked to my setup but since V2 I cannot execute any request. I get the following error:

Error executing Lua callback: ...im/lazy/luarocks.nvim/.rocks/share/lua/5.1/nio/tasks.lua:95: Async task failed without callback: The coroutine failed with this message:
.../share/nvim/lazy/rest.nvim/lua/rest-nvim/client/curl.lua:292: attempt to call method 'getinfo_effective_method' (a nil value)
stack traceback:
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/client/curl.lua: in function <.../share/nvim/lazy/rest.nvim/lua/rest-nvim/client/curl.lua:164>
stack traceback:
        [C]: in function 'error'
        ...im/lazy/luarocks.nvim/.rocks/share/lua/5.1/nio/tasks.lua:95: in function 'close_task'
        ...im/lazy/luarocks.nvim/.rocks/share/lua/5.1/nio/tasks.lua:117: in function 'step'
        ...im/lazy/luarocks.nvim/.rocks/share/lua/5.1/nio/tasks.lua:145: in function 'run'
        ...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:78: in function 'exec'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>

My Lazy setup:

  {
    "vhyrro/luarocks.nvim",
    opts = {
      rocks = { "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }, -- Specify LuaRocks packages to install
    },
    config = function()
      require("luarocks").setup({})
    end,
  },
  {
    "rest-nvim/rest.nvim",
    ft = "http",
    lazy = false,
    keys = {
      {
        "<leader>xh",
        "<cmd>Rest run<cr>",
        desc = "RestNvim"
      }
    },
    dependencies = { "luarocks.nvim" },
    config = function()
      require("rest-nvim").setup()
    end,
  }

hlidotbe avatar Mar 18 '24 15:03 hlidotbe

Hi, could you please tell me your installed version of cURL by using curl --version? That method was implemented in version 7.72.0.

Providing a pre-compiled rock binary for the lua-curl dependency should solve this problem since currently the dependency is compiled with your system's versions of the libraries.

NTBBloodbath avatar Mar 18 '24 16:03 NTBBloodbath

Indeed I have 7.68.0. I'll try to upgrade curl and hopefully it'll fix that. Thanks!

hlidotbe avatar Mar 18 '24 16:03 hlidotbe

No problem, hope I can get the binary rock setup very soon so we won't need to do this in the future. I'll pin this issue so it can have the proper discoverability in case someone else is facing the same issue, and close it once we get the binary rock to properly address this 🙂

NTBBloodbath avatar Mar 18 '24 17:03 NTBBloodbath