vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.51k stars 99 forks source link

Issues starting the app and adding it to the list of autostarted programs #394

Open pogkythunder opened 3 years ago

pogkythunder commented 3 years ago

I recently downloaded the app (the binary package) from the AUR and currently use dwm. Initially, starting the app from dmenu brings no response. In the second try, it launches normally. Same when opening it from the terminal, a second try does the trick. Because of this, it cannot be autostarted in the ~/.xinitrc. Electron suggests opening its apps with /usr/lib/electron/electron path-to-app. This gives the following error:

/opt/ElectronMail/electron-mail:1
ELF
^

SyntaxError: Invalid or unexpected token
    at wrapSafe (internal/modules/cjs/loader.js:986:16)
    at Module._compile (internal/modules/cjs/loader.js:1034:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
    at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:110:16)
    at Object.<anonymous> (/usr/lib/electron/resources/default_app.asar/main.js:222:9)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
A JavaScript error occurred in the main process
Uncaught Exception:
/opt/ElectronMail/electron-mail:1
ELF
^

SyntaxError: Invalid or unexpected token
    at wrapSafe (internal/modules/cjs/loader.js:986:16)
    at Module._compile (internal/modules/cjs/loader.js:1034:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
    at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:110:16)
    at Object.<anonymous> (/usr/lib/electron/resources/default_app.asar/main.js:222:9)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)

Running it with sudo and the --no-sandbox option (as required), gives the same error. Furthermore, in the wm side, binding a keyboard shortcut to it doesn't work at all and it does not respect the tag rules (opening it in a specific tag).

Notably, another electron app I use works fine.

Ideas?

vladimiry commented 3 years ago

The guess is that it's WM specific issue. I have no experience with dwm and don't even know what are the tag rules you mentioned.

I won't be ready to test the app using dwm in the near future. I'd suggest trying the flatpak/snap package as a possible workaround (I normally prefer flatpak to snap).

Electron suggests opening its apps with /usr/lib/electron/electron path-to-app

Don't go this way. The app should be using the exact @electron version it was released with, not the version installed on your system.

pogkythunder commented 3 years ago

Fair enough, I will keep using the app as long as it keeps working and leave the issue open for the time being. Keep up the good work!