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

[Issue] AccountSwitcher could not be constructed #79

Open
blobbyblo opened this issue Feb 19, 2022 · 18 comments
Open

[Issue] AccountSwitcher could not be constructed #79

blobbyblo opened this issue Feb 19, 2022 · 18 comments
Labels
bug Something isn't working

Comments

@blobbyblo
Copy link

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 blobbyblo added the bug Something isn't working label Feb 19, 2022
@parhammed
Copy link

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

@danieleremin
Copy link

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

@xDeFc0nx
Copy link

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,

@parhammed
Copy link

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

@blobbyblo
Copy link
Author

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.

@xDeFc0nx
Copy link

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.

@ShootingKing-AM
Copy link

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,

@ezeholz
Copy link
Contributor

ezeholz commented Mar 2, 2022

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

@blobbyblo
Copy link
Author

Your fix fixes nothing.

@Meff1u
Copy link

Meff1u commented Mar 10, 2022

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

@daNutzzzzz
Copy link

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

@NakyoykaN
Copy link

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.

@ThowZzy
Copy link

ThowZzy commented Mar 18, 2022

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
Copy link

ThowZzy commented Mar 18, 2022

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

@NakyoykaN
Copy link

NakyoykaN commented Mar 18, 2022

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.

@ThowZzy
Copy link

ThowZzy commented Mar 18, 2022

{
"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
Copy link

ThowZzy commented Mar 18, 2022

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

@NakyoykaN
Copy link

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

helloworld-1839 added a commit to helloworld-1839/AccountSwitcher that referenced this issue Mar 28, 2022
Changes Keybind classes to be defined on settings page opening.
aarondoet#79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants