Electron Apps and user-dirs.dirs

So I seem to have run across an issue running Electron Applications as snaps on Fedora 32. I can install them and they will open for the initial run, but if I close them they won’t open again. I get no message indicating that anything is wrong, they just don’t open up.

After some trial and error I found that removing the user-dirs.dirs file in ~/snap/%APP/%VERSION/.config/ allows me to reopen the snap without any further problem.

Below is an example of my user-dirs.dirs:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="/home/tyler/Desktop"
XDG_DOWNLOAD_DIR="/home/tyler/Downloads"
XDG_TEMPLATES_DIR="/home/tyler/Templates"
XDG_PUBLICSHARE_DIR="/home/tyler/Public"
XDG_DOCUMENTS_DIR="/home/tyler/Documents"
XDG_MUSIC_DIR="/home/tyler/Music"
XDG_PICTURES_DIR="/home/tyler/Pictures"
XDG_VIDEOS_DIR="/home/tyler/Videos"

Output of snap version:

snap    2.45.3.1-1.fc32
snapd   2.45.3.1-1.fc32
series  16
fedora  32
kernel  5.7.17-200.fc32.x86_64

Snaps I’ve had this occur in:

Caprine
Youtube Music Desktop Player
Bitwarden
BlueMail

Due to the lack of error messages I’m hitting a brick wall as to why this is happening. I just know what kind of applications it’s happening to and which file is causing the problem.

I’ve replicated this with riot-web on Ubuntu. Something in the startup script is causing an issue, I think. Probably desktop-common.sh.

1 Like

Is this a desktop helper’s thing (desktop-common.sh)?

Kinda. I think it’s a customised variant that electron-builder uses that is based on the desktop helpers that chains the parts of the script that the desktop helper builds instead of combining them into a single file.

Hi, I submitted a PR to try to fix this bug: https://github.com/develar/snap-armhf-electron-template/pull/1