SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.96k stars 98 forks source link

WebCord fails to launch after latest update #356

Closed TheSunCat closed 1 year ago

TheSunCat commented 1 year ago

Aknowledgements

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

20, 21, 22

Application version

WebCord v4.0.0, development build

Bug description

Hi! I just upgraded the webcord-git AUR package and it fails to launch with the following output:

$ electron22 /usr/share/webcord/app.asar
App threw an error during load
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Config.#read (/usr/share/webcord/app.asar/sources/code/main/modules/config.ts:163:17)
    at Config.get value [as value] (/usr/share/webcord/app.asar/sources/code/main/modules/config.ts:183:80)
    at Object.<anonymous> (/usr/share/webcord/app.asar/sources/code/common/main.ts:319:16)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12)
    at Function.f._load (node:electron/js2c/asar_bundle:2:13328)
    at loadApplicationPackage (/usr/lib/electron22/resources/default_app.asar/main.js:121:16)
The futex facility returned an unexpected error code.
Aborted (core dumped)```

This happens with electron21 as well, but it does not print the JSON error:

$ electron21 /usr/share/webcord/app.asar The futex facility returned an unexpected error code. Aborted (core dumped)```

If I run it with electron20, it sometimes runs and sometimes crashes.

Additional context

No response

SpacingBat3 commented 1 year ago
$ electron22 /usr/share/webcord/app.asar
App threw an error during load
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Config.#read (/usr/share/webcord/app.asar/sources/code/main/modules/config.ts:163:17)
    at Config.get value [as value] (/usr/share/webcord/app.asar/sources/code/main/modules/config.ts:183:80)
    at Object.<anonymous> (/usr/share/webcord/app.asar/sources/code/common/main.ts:319:16)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12)
    at Function.f._load (node:electron/js2c/asar_bundle:2:13328)
    at loadApplicationPackage (/usr/lib/electron22/resources/default_app.asar/main.js:121:16)
The futex facility returned an unexpected error code.
Aborted (core dumped)

I'm pretty sure the JSON part of this error shows that something's wrong once WebCord tried to parse JSON, I guess the temporary fix would be to do a cleanup of userData (which on Linux is usually at ~/.config/WebCord/).

SpacingBat3 commented 1 year ago
The futex facility returned an unexpected error code.
Aborted (core dumped)

From my tests on Weston (Wayland), this seems to occur only if XWayland server is not running (i.e. I had to install xorg-xwayland on Arch and configure Weston or run it with --xwayland flag) and there's no --ozone-platform=wayland flag set. With --verbose Chromium engine will even print that ozone_platform implementation couldn't find any X11 session or $DISPLAY (it even seems that --ozone-hint won't work as well).

I'll close this as it seems to be a lack of the user configuration. Any new information about this may reopen this issue so feel free to share your opinion and confirm if that helps.

TheSunCat commented 1 year ago

Hrm. It looks like a system update broke XWayland entirely. Thanks for looking into this! It is indeed an issue with my system.

DatAres37 commented 1 year ago

Hrm. It looks like a system update broke XWayland entirely. Thanks for looking into this! It is indeed an issue with my system.

Did you find a fix? Or is there a bug report on this issue someone call follow?

TheSunCat commented 1 year ago

It was an issue with the xorg-xwayland-hidpi-xprop AUR package, which does not work. I switched to xorg-xwayland-hidpi-xprop-git, which is out of date but works for now.

DatAres37 commented 1 year ago

Hm, I have neither of those packages installed, but thanks.

TheSunCat commented 1 year ago

Good luck! I figured it out because none of my XWayland programs were running. Weird that WebCord in Wayland mode requires XWayland, but fixing XWayland fixed it.

Gustash commented 1 year ago

I was having a similar problem with the Flatpak version. For some reason my config.json and windowState.json were completely empty, so it was failing to decode JSON.

The solution was to delete those 2 files (or you can append .old or .bak to the file extension if you don't want to delete it).

If you're using non-flatpak, those should be in $HOME/.config/WebCord and in flatpak those should be in $HOME/.var/app/io.github.spacingbat3.webcord/config/WebCord/.

DatAres37 commented 1 year ago

Deleting windowState (without .json) fixed it for me (non-Flatpak). Thanks.

Kuchenmampfer commented 1 year ago

Amazing. Deleting windowState.json fixed it. Thank you for sharing this <3