AccountSwitcher icon indicating copy to clipboard operation
AccountSwitcher copied to clipboard

[Issue] AccountSwitcher could not be constructed

Open blobbyblo opened this issue 2 years ago • 18 comments

This issue was first pointed out in #78.

Steps to reproduce the behavior:

  1. Ctrl+R inside of Discord with the AccountSwitcher plugin loaded
  2. See error
  3. (Also your bug reporter is reporting some crashes to the console as well)

Additional Information: The root of this issue is that Discord is moving towards lazy loading (see doc from mozilla).

The module you are depending on in line 118, KeyRecorder, does not get loaded until after you are in the main interface of Discord.

I suggest moving towards adding a keydown event listener as seen being used in other BD plugins I've seen. I would've opened a PR today but due to my handicap of never touching JavaScript before in my entire life, that didn't happen lmfao

blobbyblo avatar Feb 19 '22 05:02 blobbyblo

Capture I receive this error too. also, I enabled token encryption.

parhammed avatar Feb 19 '22 07:02 parhammed

I don't have token encryption and I still have the same bug. This is a problem with the discord update.

danieleremin avatar Feb 19 '22 16:02 danieleremin

I don't have token encryption and I still have the same bug. This is a problem with the discord update.

Hi, this is a bug with account switcher itself, everyone has the same error, lets hope it gets fixed, ill take look and try to fix it,

xDeFc0nx avatar Feb 19 '22 23:02 xDeFc0nx

I don't have token encryption and I still have the same bug. This is a problem with the discord update.

Hi, this is a bug with account switcher itself, everyone has the same error, lets hope it gets fixed, ill take look and try to fix it,

tnx

parhammed avatar Feb 20 '22 04:02 parhammed

I have made my own plugin to allow account switching using keydown and keyup event handlers. Maybe this code will be useful for this plugin and someone else can port over the changes.

blobbyblo avatar Feb 21 '22 00:02 blobbyblo

I have made my own plugin to allow account switching using keydown and keyup event handlers. Maybe this code will be useful for this plugin and someone else can port over the changes.

Hello, thank you very much.

xDeFc0nx avatar Feb 23 '22 00:02 xDeFc0nx

I also have the same issue with the latest version of plugin.

Having the same issue, i got these logs if they would be useful to the dev. I think there is something wrong with the Libraries this plugin is using, WebpackModules esp.

AccountSwitcher.plugin.js:119 Uncaught TypeError: Class extends value undefined is not a constructor or null
    at plugin (AccountSwitcher.plugin.js:119)
    at AccountSwitcher.plugin.js:579
    at AccountSwitcher.plugin.js:580
    at AccountSwitcher.plugin.js:581
    at AccountSwitcher.plugin.js:586
    at Object.getFileModification (<anonymous>:4:307707)
    at Object..js (<anonymous>:4:267851)
    at Function.o._load (<anonymous>:4:370475)
    at Object.loadAddon (<anonymous>:4:268008)
    at Object.loadAddon (<anonymous>:4:305956)
    at Object.loadAllAddons (<anonymous>:4:270683)
    at Object.initialize (<anonymous>:4:265130)
    at Object.initialize (<anonymous>:4:305166)
    at Object.startup (<anonymous>:4:367245)

LineNo 119 corresponds to, const KeyRecorder def,

					}
				);
			}
			
			const KeyRecorder = class KeyRecorder extends WebpackModules.getByDisplayName("KeyRecorder") {
				render() {
					const ButtonOptions = WebpackModules.getByProps("ButtonLink");
					const Button = ButtonOptions.default;
					const ret = super.render();
					ret.props.children.props.children.props.children.push(
						React.createElement(
							DiscordModules.FlexChild,

ShootingKing-AM avatar Feb 27 '22 23:02 ShootingKing-AM

~This is not a full fix, and should not be treated like one. But I fix this error for those who had the plugin already configured. I heavily doubt this could be a final version, mostly because I believe it's gonna crash the minute you open the settings menu of the plugin. Feel free to use it until I try to fix this error. :D https://github.com/ezeholz/AccountSwitcher/tree/hotfix-78~

It's not worth it anymore, just wait until discord provides it

ezeholz avatar Mar 02 '22 04:03 ezeholz

Your fix fixes nothing.

blobbyblo avatar Mar 02 '22 20:03 blobbyblo

This is not a full fix, and should not be treated like one. But I fix this error for those who had the plugin already configured. I heavily doubt this could be a final version, mostly because I believe it's gonna crash the minute you open the settings menu of the plugin. Feel free to use it until I try to fix this error. :D https://github.com/ezeholz/AccountSwitcher/tree/hotfix-78

Discord crashes when trying to switch account image

Meff1u avatar Mar 10 '22 15:03 Meff1u

This is not a full fix, and should not be treated like one. But I fix this error for those who had the plugin already configured. I heavily doubt this could be a final version, mostly because I believe it's gonna crash the minute you open the settings menu of the plugin. Feel free to use it until I try to fix this error. :D https://github.com/ezeholz/AccountSwitcher/tree/hotfix-78

This worked for me, thanks

daNutzzzzz avatar Mar 13 '22 16:03 daNutzzzzz

None of the above solutions seem to work whether it is the current Localhost version or the Omen one.

It appears to me that anyone installing this for the first time is going to encounter the same issue that I did that a fresh install disables the setup button and there appears to be no easy/simple way to set up accounts to continue using this plugin.

This is on top of the current issue continuing to pop up. Moving the plugin out of and back into the plugin folder does not resolve the inability to set up new accounts.

Any chance this can be fixed or a proper/official solution can be updated on the read me to confirm what users should do doing going forward? This might save other users the frustrations that I had.

NakyoykaN avatar Mar 16 '22 19:03 NakyoykaN

This is not a full fix, and should not be treated like one. But I fix this error for those who had the plugin already configured. I heavily doubt this could be a final version, mostly because I believe it's gonna crash the minute you open the settings menu of the plugin. Feel free to use it until I try to fix this error. :D https://github.com/ezeholz/AccountSwitcher/tree/hotfix-78

This worked for me, thanks

It totally works mate, just need to comment out lines 118 --> 170 ty

ThowZzy avatar Mar 18 '22 14:03 ThowZzy

The current fix is to config the plugin as you want, and once you configured it just comment the lines mentionned and you good

ThowZzy avatar Mar 18 '22 14:03 ThowZzy

The setup button is grayed out for me so I am unable to get a box to add/remove accounts or adjust the keybindings. This is after reloading the plugin with or without the 118=>170 lines commented out.

I would use the built in account switcher if it wasn't for the fact that it limits you to five accounts. Perhaps if this is implemented as is then this mod can use that same menu but allow more accounts to be added after the first 5.

NakyoykaN avatar Mar 18 '22 18:03 NakyoykaN

{ "didShowIssueHelperPopup": true, "currentVersionInfo": { "version": "1.3.5", "hasShownChangelog": true }, "settings": { "accounts": [ { "name": "TAG#1111", "id": "123431231", "avatar": "https://cdn.discordapp.com/avatars/111111/11111111.webp?size=128", "keybind": [ 160, 37 ], "token": "token" }, { "name": "TAG#1111", "id": "1111", "avatar": "https://cdn.discordapp.com/avatars/1111/1111.webp?size=128", "keybind": [ 160, 39 ], "token": "token" } ], "encrypted": false, "encTest": "test", "pluginsToRestart": [ "AccountDetailsPlus", "AutoStartRichPresence" ], "encryptionVersion": 2, "salt": "PHStMmwqFoZm5ToErFseA8T7BI/Cb/AozuiOUZD5Wzc=" } }

ThowZzy avatar Mar 18 '22 20:03 ThowZzy

You can try to do your config by hand with this template I sent

ThowZzy avatar Mar 18 '22 20:03 ThowZzy

Tried this and now I get the same issue as earlier reported where the Discord account switcher interferes.

NakyoykaN avatar Mar 22 '22 17:03 NakyoykaN