Skip to content

Rest run => Async task failed without call back: The coroutine failed #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
uchoa opened this issue Feb 28, 2025 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@uchoa
Copy link

uchoa commented Feb 28, 2025

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin
  • I can reproduce the bug with minimal config below

Neovim Version

NVIM v0.10.4 Build type: Release LuaJIT 2.1.1736781742

Operating system/version

macOS Sequoia 15.3.1

Actual behavior

When I call :Rest run on any endpoint, I get this error:

Error executing Lua callback: .../uchoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:100: Async task failed without callback: The coroutine failed with this message:
...re/nvim/lazy/rest.nvim/lua/rest-nvim/client/curl/cli.lua:360: attempt to index field 'handle' (a nil value)
stack traceback:
        ...re/nvim/lazy/rest.nvim/lua/rest-nvim/client/curl/cli.lua: in function 'request'
        ...ocal/share/nvim/lazy/rest.nvim/lua/rest-nvim/request.lua:64: in function 'run_request'
        ...ocal/share/nvim/lazy/rest.nvim/lua/rest-nvim/request.lua:120: in function <...ocal/share/nvim/lazy/rest.nvim/lua/rest-nvim/request.lua:109>
stack traceback:
        [C]: in function 'error'
        .../uchoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:100: in function 'close_task'
        .../uchoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:122: in function 'step'
        .../uchoa/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:150: in function 'run'
        ...ocal/share/nvim/lazy/rest.nvim/lua/rest-nvim/request.lua:109: in function 'run'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:124: in function 'impl'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:309: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:297>

Expected behavior

I expected the request to be executed as declared in the .http file.

Steps to reproduce

Open the .http file, place the cursor on a request and :Rest run.

curl --version:

curl 8.7.1 (x86_64-apple-darwin24.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.63.0
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets

luajit -v
LuaJIT 2.1.1736781742 -- Copyright (C) 2005-2025 Mike Pall. https://luajit.org/

Minimal config for repro (using lazy.nvim)

My rest.lua (lazy.nvim) is this:


return {
	"rest-nvim/rest.nvim",
	dependencies = {
		{
			"nvim-treesitter/nvim-treesitter",
			opts = function(_, opts)
				opts.ensure_installed = opts.ensure_installed or {}
				table.insert(opts.ensure_installed, "http")
			end,
		},
		{
			"vhyrro/luarocks.nvim",
			priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
			config = true,
		},
	},
}


In fact I didn't have the luarocks dependency declared. Added it after the plugin started crashing.

Other information

No response

@uchoa uchoa added the bug Something isn't working label Feb 28, 2025
@rest-nvim rest-nvim locked and limited conversation to collaborators Mar 2, 2025
@boltlessengineer boltlessengineer converted this issue into a discussion Mar 2, 2025
@boltlessengineer boltlessengineer converted this issue into a discussion Mar 2, 2025
@boltlessengineer
Copy link
Contributor

Seems like you are having installation issues. Here are some steps to check your issue:

  • run :checkhealth lazy. See what luarocks section says. you should enable the rockspec support to install this plugin (no need to install luarocks.nvim if you are using lazy.nvim v11 or higher)
  • run :checkhealth rest-nvim. rest.nvim can diagnostic itself and check if every dependencies are properly installed.
  • follow guide from Installation Troubleshooting Guide #498 if anything seems broken.

Tell me if you still have any problem setting up this plugin!

btw why can't I convert this to discussion... Github is being weird these days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants