WebCord: Unexpected end of JSON input
Acknowledgements
-
I have checked that there is no other issue describing the same or similar problem that I currently have, regardless if it has been closed or open.
-
This bug affects Discord website.
-
This issue is confirmed to be reproduceable when WebCord is packaged on at least all three latest supported Electron major releases.
-
This issue is reproduceable in Chrome, Chromium or any Chromium-based browser, e.g Brave or Edge (please write in Additional Context which browser you have used if it is neither Chrome nor unmodified Chromium).
-
There are no fixes done to
masterwhich resolves this issue. -
My issue describes one of the unstable and/or not fully implemented features.
-
I have found a workaround to mitigate or temporarily fix this issue in affected releases (please write it in Additional context section below).
Operating System / Platform
đ§ď¸ Linux
Operating system architecture
x64 (64-bit Intel/AMD)
Electron version
Unable to boot, so cannot get version
Application version
4.1.1 and 4.1.0
Bug description
I have tried both WebCord 4.1.1 and 4.1.0 and the issue regardless. The application does not boot and it gives the following error
Unexpected end of JSON input
at WinStateKeeper.#read(sources/code/main/modules/config.ts:163:17)
at WinStateKeeper.get value [as value] (sources/main.modules/config.ts:183:80)
at new Config (sources/code/main/modules/config.ts:217:48)
at new WinStateKeeper (sources/code/main/modules/config.ts:300:5)
at createMainWindow (sources/code/main/windows/main.ts:43:27)
at App.main (sources/code/common/main.ts:370:40)
Restarting my machine does not help.
Additional context
There is a workaround thanks to @OwczarekGit. Deleting the file windowState in ~/.config/WebCord lets me start WebCord again and I do not see any immediate issues.
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 39
- Comments: 38 (2 by maintainers)
As a workaround You can remove
windowStatefile in~/.config/WebCordto make webcord start again.@DigiOhhh Mentioning the workaround once is fine. Repeating the same workaround multiple times is spam, and more importantly does not resolve the issue faster. This is a primarily one-person project and said person is well aware of the issue and performing a rewrite (at the pace that life allows).
If you feel you cannot use the software, nothing prevents you from patching it yourself or using an alternative. I canât believe I need to say this, but this is common etiquette that âme tooâ comments are not helpful on an issue tracker.
If youâre not contributing info to help fix the issue, maybe calm down with the comment spam on removing windowstate or config.json or the âitâs happening to me too!â Issue comments should be for actually moving the issue forward.
On that note, since there appears to be a rewrite in progress anyway (see the
nextbranch of this repo), it doesnât make sense to discuss this further until the rewrite is done since it might not even be an issue anymore.I have the exact same issue, and like everyone said, removing the
windowState.jsonfile fixes it.Workaround: After successfully opening WebCord, close it and remove write permission to the
windowState.jsonfile. That way you wonât have to remove it manually on every single boot.You donât have to reboot if you press the
Abortbutton. If you pressIgnoreyouâll have to kill allwebcordprocesses running in the background and after that WebCord will start.Yeah I plan to rewrite how
Configworks, mostly I think of implementing the class generic enough to work outside of Electron and WebCord (and maybe release it as a separate module?).I also consider of polishing some of the modules like
l10nandpackage.jsonto make them functional as separate modules published in NPM, these could be useful for anyone dealing with multiplepackage.jsonfiles (WebCord does that to generate a list of dependencies in About window and information about their licenses).I wanted to do a rewrite as I feel unhappy with the current source code, I think nothing is alright and some stuff are too complex than they should be. Even the
nextis not fully what I think it is supposed to be, I probably want to make some stuff as actual separate modules â with TypeScript you should be able to choose what you really want to build in WebCord, so you can skip stuff like Electon Forge configuration if you donât depend on it to package.And I didnât wanted to continue to develop
4.x.yas I feel I should start doing some stuff than keep planning. Contributing to code that will eventually be just deprecated seems rather unproductive. On the other hand, fixing some critical bugs just to make my client to work and release it on newer Electron version if supported without any breakages might keep my client at least alive, so I wonder if not to do that.I remind that I still wonât be able to invest that much time through, so if I will work on rewrite, the development (or any kind of changes near WebCord) will be rather slow.
This just happened to me as well, there was a 0kb
~/.config/WebCord/windowState, deleting it fixed the issue.For me, I had to remove
config.json. (also an empty file)For flatpak users:
alias webcordbrokeagain='rm /home/gramdalf/.var/app/io.github.spacingbat3.webcord/config/WebCord/windowState'