eNkru/freelook

Config directory doesn't exist

sabrehagen opened this issue · 8 comments

When starting the first time the /home/$USER/.config/Freelook directory does not exist.

A JavaScript error occurred in the main process
Uncaught Exception:
Error: ENOENT: no such file or directory, open '/home/jackson/.config/Freelook/Settings'
    at Object.openSync (fs.js:453:3)
    at Object.func [as openSync] (electron/js2c/asar.js:155:31)
    at Object.writeFileSync (fs.js:1246:35)
    at Object.writeFileSync (/opt/Freelook/resources/app.asar/node_modules/jsonfile/index.js:117:13)
    at Settings._ensureSettings (/opt/Freelook/resources/app.asar/node_modules/electron-settings/lib/settings.js:153:18)
    at Settings._readSettings (/opt/Freelook/resources/app.asar/node_modules/electron-settings/lib/settings.js:192:10)
    at Settings._getValueAtKeyPath (/opt/Freelook/resources/app.asar/node_modules/electron-settings/lib/settings.js:281:22)
    at Settings.get (/opt/Freelook/resources/app.asar/node_modules/electron-settings/lib/settings.js:404:17)
    at Object.<anonymous> (/opt/Freelook/resources/app.asar/src/js/css-injector.js:7:17)
    at Module._compile (internal/modules/cjs/loader.js:815:30)
libGL error: MESA-LOADER: failed to retrieve device information
eNkru commented

This looks familiar. I've been fixed this for other Electron apps but not this one.

This only occurred first time when you run the app because the app setting directory not existing. You shouldn't see this anymore unless manually deleted the setting folder.

I'll log this and try to fix in the next version. Thanks for the reporting.

sier commented

Can confirm, happens on first launch on macOS as well.

Something about the electron-settings being used outside of app.on('activate', () seems to be causing it IIRC, since it tries to load in settings from a yet-to-exist directory.

eNkru commented

yes. this is been confirmed that the setting folder isn't exist for the first time launch. then the app will create the folder. You shouldn't see this error again after the first launch.

will add a condition to fix this in the next release.

sier commented

Something is up with settings.js and/or setting-controller (as well as css-injector.js).

Not quite sure what the specific issue is, but the electron-settings are messed up and used wrong somehow.

eNkru commented

Hi @sier, please don't remove the features for electron settings. It support the customise the home urls for both hotmail and office.com users.

I know exactly how to fix this error just need some time to do it. I've got the same error in my other apps and already been fixed.

Please remove that part also remove the part for version change. It will be changed automatically when I doing the release. and I like your other changes in the pull request. Will merge in to master once you've done :)

sier commented

Hey @eNkru, edited it to only include the changes to the menu and package.json

Cheers!

#19 (review)

eNkru commented

@sier I've merged your change into master. Will work on the fix for this original issue :)

eNkru commented

the error on the first start is fixed by the following commit.

c6287e3