rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.49k stars 137 forks source link

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

Open hlidotbe opened 6 months ago

hlidotbe commented 6 months ago

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,
  }
NTBBloodbath commented 6 months ago

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.

hlidotbe commented 6 months ago

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

NTBBloodbath commented 6 months ago

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 🙂