buttercup-desktop
buttercup-desktop copied to clipboard
JSON parse error on config read
Buttercup was working fine until yesterday, when it stops opening the UI, now i can use only for the extensions, i tried to open it from powershell and here is my output:
[INF] 02:45:10: Application starting ❮
[INF] 02:45:10: Protocol already registered: buttercup
[INF] 02:45:10: Application ready
[INF] 02:45:10: Application session started: 2021-12-02T02:45:10.079Z
[INF] 02:45:10: Logs location: C:\Users\pedro\AppData\Local\Buttercup-nodejs\Log\buttercup-desktop.log
[ERR] 02:45:10: SyntaxError: Unexpected token in JSON at position 0
at undefined
at parse
at <anonymous> resources/app.asar/build/main/library/FileStorage.js:66 return JSON.parse(data);
at next
at fulfilled resources/app.asar/build/main/library/FileStorage.js:5 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { re…
That's a path related issue.
Same issue in MacOS Catalina
The solution for me was add {}
to the config file
echo "{}" > ~/Library/Preferences/Buttercup-nodejs/desktop.config.json
Same issue here on Windows. I have to delete the file in C:\Users\ username \Roaming\Buttercup-nodejs\Config\desktop.config.json to fix Buttercup.
Has anyone taken a look at what the file looks like before deleting/changing it? Is it empty/incomplete/corrupted? As I've never seen this issue I have no idea what Buttercup might be doing for the file to end up this way.
@perry-mitchell The files was empty, so an error occurs when the app tries to parse an empty json file
Hopefully someone can debug this on windows at some point, as I've not been able to reproduce it. We use standard Node calls to write the config, so I don't know what could cause this.
Same error for me on Zorin OS 16.3, fixed by the same solution than @alfreedom
The solution for me was add
{}
to the config file
echo "{}" > ~/Library/Preferences/Buttercup-nodejs/desktop.config.json
@pippo571 Any chance you might check your logs for before this issue happened? Anything there indicating an error when writing the config file?
EDIT: It might be an idea for us to write a verification call to the config after updating it, to ensure it was written correctly.