You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when registering a command from a folder that is not in the plugin directory (meaning, you created a symlink to an external directory), then powercord fails with this error:
An error occurred during initialization! TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
at CommandsAPI.registerCommand (VM828 commands.js:56)
at PowerBottom.startPlugin (VM1337 index.js:100)
at async PowerBottom._load (VM133 Plugin.js:127)
To Reproduce
Create a symlink in your plugin dir to another dir
Make a simple plugin that registers a command.
The error will occur when the command is attempting to be registered.
(Hell, the object passed to the registerCommand method can even be null, that will still cause the error.)
Expected behavior
Powercord doesn't rely on directory hard path for command registration.
Perhaps instead it could work like this:
All the methods to register settings/commands use methods from the plugin class, and then the plugin class has a name that it registers.
That way, it uses the name property instead of the hacky error trace code that can break.
Or just use the stack trace, but then instead of matching with the plugin dir, it just replaces the plugin dir with an empty string, replaces . with /, and then trims the first /.
Desktop (please complete the following information):
I checked if Discord and/or Powercord are up to date
I made sure this is not related to an external plugin or a theme (it can only be caused with an external plugin, but it is powercord that has the bug.)
Add any other context about the problem here.
Here is a link to the exact line on which it occurs.
The text was updated successfully, but these errors were encountered:
I never truly gave attention to support for symlinked plugins, and given the current state of Powercord (maintenance, with bigger problems to worry about with Discord's roll out of forced context isolation), I don't know if this will ever be worked on, and the fix most likely will be v3 (since v3 core is very different from v2 core)
I like keeping my dev environments all in the same place, so I can quickly find projects in intellij. (I keep all programming projects in ~/Programming/[Language Name]/*)
And since there's no good way to set a custom plugin dir, I thought a symlink would be the best.
Alternatively, you could just add some simple way to add a dir that contains a plugin (Meaning, if the dir is /abcd/123/, then it looks for /abcd/123/index.js.), which is loaded along with the rest of the plugins.
(It doesn't have to be anything fancy, and should be devs only. So just make it a .json file somewhere, that holds a list of key:value pairings, where the key is the name and the value is the dir. It's hacky, but works. Or something like that.)
Describe the bug
when registering a command from a folder that is not in the plugin directory (meaning, you created a symlink to an external directory), then powercord fails with this error:
To Reproduce
Create a symlink in your plugin dir to another dir
Make a simple plugin that registers a command.
The error will occur when the command is attempting to be registered.
(Hell, the object passed to the
registerCommand
method can even be null, that will still cause the error.)Expected behavior
Powercord doesn't rely on directory hard path for command registration.
Perhaps instead it could work like this:
All the methods to register settings/commands use methods from the plugin class, and then the plugin class has a name that it registers.
That way, it uses the name property instead of the hacky error trace code that can break.
Or just use the stack trace, but then instead of matching with the plugin dir, it just replaces the plugin dir with an empty string, replaces
.
with/
, and then trims the first/
.Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Here is a link to the exact line on which it occurs.
The text was updated successfully, but these errors were encountered: