Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Crash on launch: app.makeSingleInstance is not a function #358

Closed
jgierer12 opened this issue Jun 8, 2019 · 10 comments
Closed

Crash on launch: app.makeSingleInstance is not a function #358

jgierer12 opened this issue Jun 8, 2019 · 10 comments

Comments

@jgierer12
Copy link
Contributor

After upgrading from v3.0.9 to v3.0.12, the app crashes immediately when trying to launch it:

$ standardnotes-desktop 
App threw an error during load
TypeError: app.makeSingleInstance is not a function
    at Object.<anonymous> (/opt/standardnotes-desktop/app/dist/index.js:182:28)
    at Object.<anonymous> (/opt/standardnotes-desktop/app/dist/index.js:212:3)
    at Module._compile (internal/modules/cjs/loader.js:693:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Object.<anonymous> (/usr/bin/standardnotes-desktop:30:19)
    at Object.<anonymous> (/usr/bin/standardnotes-desktop:32:3)
    at Module._compile (internal/modules/cjs/loader.js:693:30)
TypeError: app.makeSingleInstance is not a function
    at Object.<anonymous> (/opt/standardnotes-desktop/app/dist/index.js:182:28)
    at Object.<anonymous> (/opt/standardnotes-desktop/app/dist/index.js:212:3)
    at Module._compile (internal/modules/cjs/loader.js:693:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Object.<anonymous> (/usr/bin/standardnotes-desktop:30:19)
    at Object.<anonymous> (/usr/bin/standardnotes-desktop:32:3)
    at Module._compile (internal/modules/cjs/loader.js:693:30)
Checking for updates...
Finished checking for updates. Latest version: 3.0.12 Current version: 3.0.12
System specs
Host: XPS 13 9370 
OS: Manjaro Linux x86_64 
Kernel: Linux 5.1.4-1-MANJARO 
CPU: Intel i7-8550U (8) @ 4.0GHz 
GPU: Intel UHD Graphics 620 
Memory: 4514MiB / 15756MiB 
Resolution: 1920x1080 
Packages: 1408 (pacman) 
Shell: fish 3.0.2 
Terminal: tilix 
DE: GNOME 3.32.2 
Theme: Adwaita 
Icons: Suru++ 
Font: Inter 13 
@moughxyz
Copy link
Member

moughxyz commented Jun 8, 2019

Strange. Any ideas @rjocoleman? The docs for Electron 1.8.8 definitely state this is a function.

@rjocoleman
Copy link
Contributor

Interesting. @jgierer12 Where did you get the package from - https://standardnotes.org or somewhere else? Is it the Official AppImage or from a distro's package management?

@MrMette
Copy link

MrMette commented Jun 8, 2019

I have the same problem. Mine is from the Arch Linux AUR, so my guess is it's the same for him as he is using Manjaro (I am using Arch Linux).

It also gives:
Gtk-WARNING **: 22:17:51.451: Locale not supported by C library.
Using the fallback 'C' locale

Not sure if that has anything to do with it.

So it's possible it has to do with the code of the AUR instead of the software itself.

@rjocoleman
Copy link
Contributor

Ah, right, AUR is building with Electron 4 (soon to be 5) where as this app is still using the v1 API.
https://electronjs.org/docs/tutorial/electron-versioning

Technically a packaging issue, but I'll see what I can do

@rjocoleman
Copy link
Contributor

By the way, this issues does not affect the official AppImage available here: https://standardnotes.org/extensions?downloaded=linux

@rjocoleman
Copy link
Contributor

@mobitar a fix for this is in #359

@rjocoleman
Copy link
Contributor

rjocoleman commented Jun 8, 2019

I've filed a quick note with the AUR package that appears to be used here too with an interim patch, to hopefully alleviate any release pressure - as there is no guarantee @mobitar will agree with the technique used in #359 or be able to release it quickly.

https://aur.archlinux.org/packages/standardnotes-desktop/#news

If anyone effected wants to build and install it themselves and use that package the steps are:

git clone https://aur.archlinux.org/standardnotes-desktop.git
cd standardnotes-desktop
curl -O https://gist.githubusercontent.com/rjocoleman/6279ea9f11885f13383867a9b70408a9/raw/d5b8dbef8015ed2c40c858308c01d45f451dfed6/standardnotes-desktop-aur-deprecation.patch
git apply standardnotes-desktop-aur-deprecation.patch
makepkg -si

That said - my work doesn't address any other potential API inconsistencies. It only touches the startup check for an existing instance of the app. The official StandardNotes distributed AppImage is the best way to use this application on Linux as it's got all the dependencies at the correct versions (and AUR doesn't allow an elegant way to do that for Electron).

@MrMette
Copy link

MrMette commented Jun 10, 2019

Your patch seemed to be applied into the AUR package and it works again. I also tested the AppImage and that one obviously works as well. I will test next update which one of those is the easiest to update and use that one going forward.

Thank you very much for fixing this so quickly.
Hopefully it's fixed for the original poster as well.

@jgierer12
Copy link
Contributor Author

Yes, the patch fixes the issue for me as well. Thanks a lot @rjocoleman 🙏

@moughxyz
Copy link
Member

Thanks for the quick resolution @rjocoleman! This will be great too as we're wanting to upgrade to Electron 5 in an upcoming release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants