Volumio plugin refresh - changes to index.js are not seen/old version of index.js runs - SOLVED: run volumio vrestart

I’m writing a plugin on Version 2.868. I wrote a plugin before and didn’t have this issue…

When I run volumio plugin refresh the data\plugins\miscellanea\my_plugin folder is updated and changes to index.js are made as expected but the new version of index.js is never executed, only the previous version runs. I can also delete index.js and the plugin still runs as normal!

Is the script being cached/copied somewhere else? Changes to UIConfig.json display immediately.

Restarting the pi is the only to update my plugin. :frowning:

What is happening?

Cheers
Supercrab

I can confirm the issue which has been reported on GitHub.

You can workaround it by excuting

volumio vrestart

after refreshing.

1 Like

Yep, unfortunately the plugin system doesn’t allow for hot-loading plugins, so indeed you will need to restart the full Volumio node backend to reload the plugin.

1 Like

Ah cool! That worked - I thought I was gonna mad!

Thanks

Thanks for your help. I don’t suppose you know when/what version the plugin manager was changed?

Not sure I follow - AFAIK, there was never plugin hotloading, you always had to restart the node process with systemctl restart volumio or the uglier killlall node

1 Like

Yes, I agree and calling it an “issue” is maybe too much. But before I discovered this point for myself I had the expectation that volumio plugin refresh takes care of the new plugin version to be running without having to restart the node process. I have to admit though that there is barely an indication in the docs for this assumption. Back then I have probably been mislead by the phrase “Call the utility with this command if you worked on the source and you want a plugin to be updated locally” and the finishing message “Plugin succesfully refreshed”. :innocent:

It was a couple of years ago when I wrote my first plugin. I’ve probably forgotten how I did it. :frowning: The documentation for writing plugins does’t mention restarting volumio to apply the changes.

There is one last thing: I’ve added a dependency to sleep in package.json but it does not get installed to the plugin’s node_plugins folder. Is there anything else I need to do?

EDIT: I've worked it out. I need to run volumio plugin update to get the necessary packages! :blush:

Thanks for your help!

I agree with you guys: it’s definitely not an issue, it’s just a limitation of the plugin manager. I think the documentation is great but this part could be made a little clearer :smiley:

Created a PR.

1 Like