cerebroapp / cerebro

🔵 Cerebro is an open-source launcher to improve your productivity and efficiency
https://www.cerebroapp.com/
MIT License
8.27k stars 454 forks source link

Provide more user clues when config.json is broken and Cerebro does not start #649

Closed Aggtaa closed 1 year ago

Aggtaa commented 1 year ago

Trying to start Cerebro 0.10.0 on Ubuntu 22.04 from .deb release, from .AppImage and from a cloned repo tag v0.10.0, get the same error every time:

A JavaScript error occurred in the main process
Uncaught Exception:
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at T._deserialize (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:2:40655)
    at get store [as store] (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:2:44141)
    at new T (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:2:41902)
    at new e.exports (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:8:31842)
    at 9641 (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:2:30510)
    at r (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:8:68066)
    at /tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:8:68576
    at Object.<anonymous> (/tmp/.mount_CerebrgxI8tr/resources/app.asar/main.js:8:68602)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
emilioidk commented 1 year ago

I had a similar issue some time ago it was because the Cerebro config file was malformed. You should check the file ~/.config/Cerebro/config.json, if it doesn't look like a valid JSON file you can delete it (Cerebro will recreate it when you open it) or change the name if you are not sure.

Aggtaa commented 1 year ago

Thank you @emilioidk!

There was an empty file ~/.config/Cerebro/config.json, removing it allowed Cerebro app to start and recreate content of the file.

In this case I would rephrase this topic for the issue to lead for better UX on malformed/broken config issue resolution.

ogustavo-pereira commented 1 year ago

It seems that everything has been understood here I will close.