Skip to content
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

[Bug] Error switching from remote to local plugin installation #16

Open
bottd opened this issue Jun 4, 2024 · 2 comments
Open

[Bug] Error switching from remote to local plugin installation #16

bottd opened this issue Jun 4, 2024 · 2 comments

Comments

@bottd
Copy link
Contributor

bottd commented Jun 4, 2024

When I have a plugin installed remotely such as rocks-dev.nvim and update my config to point to a directory, I get the following error on :Rocks sync

Error executing vim.schedule lua callback: ...vim/rocks/rocks_rtp/lua/rocks-dev/local-rock-handler.lua:21: attempt to call field 'remove' (a nil value)
stack traceback:
        ...vim/rocks/rocks_rtp/lua/rocks-dev/local-rock-handler.lua:21: in function 'callback'
        ....local/share/nvim/rocks/share/lua/5.1/rocks/api/init.lua:87: in function 'cb'
        ...bott/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:102: in function 'close_task'
        ...bott/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:124: in function 'cb'
        ...bott/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:185: in function 'waiter'
        ...tt/.local/share/nvim/rocks/share/lua/5.1/nio/control.lua:116: in function 'wake'
        ...tt/.local/share/nvim/rocks/share/lua/5.1/nio/control.lua:129: in function 'set'
        ...tt/.local/share/nvim/rocks/share/lua/5.1/rocks/state.lua:39: in function 'on_exit'
        ....local/share/nvim/rocks/share/lua/5.1/rocks/luarocks.lua:69: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

In local-rock-handler I believe operations should require from rocks.operations.helpers. After making this change locally I get a new error in my rocks log:

ERROR | 2024-06-03 21:44:07 | ...share/nvim/rocks/share/lua/5.1/rocks/operations/init.lua:99 | SYNC ERROR: rocks-dev: Message: ...bott/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:195: Cannot call async function from non-async context
@mrcjkb
Copy link
Member

mrcjkb commented Jun 4, 2024

Hey 👋

Thanks for reporting. 🙏

Yes, rocks-dev isn't using the rocks.nvim public API, and the internal module (rocks.operations) it is using has changed without a major version bump (since it's an internal API).

The second error message is strange, because it should be called within an async context.
@vhyrro since you use rocks-dev.nvim, could you check this?

I'll push a hotfix for the operations module, although we should be using a public API.

@bottd
Copy link
Contributor Author

bottd commented Jun 4, 2024

Happy to report 😄 thank you for looking at this and getting a fix created! Look forward to using this soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants