wojtkowiak / meteor-desktop

Build a Meteor's desktop client with hot code push.
MIT License
448 stars 84 forks source link

Electron >=v4 "makeSingleInstance is not a function", replaced in Electron v4 #277

Open evan-coygo opened 4 years ago

evan-coygo commented 4 years ago

https://github.com/wojtkowiak/meteor-desktop/blob/5aea4ccc6983c52e0196a01c38c9bc3a591e502d/skeleton/app.js#L131

If you have single instance enable the app.makeSingleInstance() function is used but it was replaced in Electron v4, see release notes https://www.electronjs.org/blog/electron-4-0. app.requestSingleInstanceLock() should be used instead

evan-coygo commented 4 years ago

In the meantime anyone who stumbles on this can fix this yourself by just setting "singleInstance" to false in .desktop/settings.json, then adding this in your .desktop/desktop.js constructor() method:

    // ensure only a single instance of the app can be run
    const gotTheLock = app.requestSingleInstanceLock();
    if (!gotTheLock) {
      return app.quit();
    }