Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start desktop app inside electron: app.makeSingleInstance is not a function #7945

Closed
ploth opened this issue Dec 22, 2018 · 15 comments

Comments

@ploth
Copy link

ploth commented Dec 22, 2018

Description

npm run electron throws error

> riot-web@0.17.8 electron /home/ploth/projects/riot-web
> npm run install:electron && electron .


> riot-web@0.17.8 install:electron /home/ploth/projects/riot-web
> install-app-deps

  • please use as subcommand: electron-builder install-app-deps
  • electron-builder version=20.29.0
  • loaded configuration file=package.json ("build" field)
  • installing production dependencies platform=linux arch=x64 appDir=/home/ploth/projects/riot-web/electron_app
App threw an error during load
TypeError: app.makeSingleInstance is not a function
    at Object.<anonymous> (/home/ploth/projects/riot-web/electron_app/src/electron-main.js:103:24)
    at Object.<anonymous> (/home/ploth/projects/riot-web/electron_app/src/electron-main.js:277: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 loadApplicationPackage (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:119:12)
    at Object.<anonymous> (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:164:5)
    at Object.<anonymous> (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:204:3)
Unhandled exception TypeError: app.makeSingleInstance is not a function
    at Object.<anonymous> (/home/ploth/projects/riot-web/electron_app/src/electron-main.js:103:24)
    at Object.<anonymous> (/home/ploth/projects/riot-web/electron_app/src/electron-main.js:277: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 loadApplicationPackage (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:119:12)
    at Object.<anonymous> (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:164:5)
    at Object.<anonymous> (/home/ploth/projects/riot-web/node_modules/electron/dist/resources/default_app.asar/main.js:204:3)

Steps to reproduce

  • git clone https://github.com/vector-im/riot-web.git
  • cd riot-web
  • npm install
  • npm run build
  • npm install electron
  • npm run electron

Expectation: Normal startup of the riot desktop client

Version information

  • Platform: Desktop
  • OS: Gentoo
  • Version: 0.17.8 (current master branch)
  • Electron version: 4.0.0
$ npm --version
6.4.1
$ node --version
v8.12.0
@t3chguy
Copy link
Member

t3chguy commented Dec 22, 2018

Version of electron would be handy here.

@ploth
Copy link
Author

ploth commented Dec 22, 2018

$ npm install electron

> electron@4.0.0 postinstall /home/ploth/projects/riot-web/node_modules/electron
> node install.js

npm WARN slate@0.41.3 requires a peer of immutable@>=3.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN slate-html-serializer@0.6.32 requires a peer of immutable@>=3.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN slate-plain-serializer@0.6.33 requires a peer of immutable@>=3.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN slate-prop-types@0.4.67 requires a peer of immutable@>=3.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN slate-react@0.18.11 requires a peer of immutable@>=3.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@2.1.1 (node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-win@2.1.1: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@1.0.1 (node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ electron@4.0.0
updated 1 package and audited 21124 packages in 10.952s
found 5 vulnerabilities (4 low, 1 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

@t3chguy
Copy link
Member

t3chguy commented Dec 22, 2018

Try with electron 3, 4 is brand new and has removed that API. The change has already been merged to develop to stop using that removed API so you could equally switch branch. Though seeing some talk this morning I'm not sure if riot supports the brand new electron 4 in other ways yet, pending on a PR being released on their end

@ploth
Copy link
Author

ploth commented Dec 22, 2018

Works with electron 3.0.13. Thank you!

How to install electron 3?

npm install electron@3

@ploth ploth closed this as completed Dec 22, 2018
@lapineige
Copy link

Hello,

It doesn't work for me with electron 3.1.1.
What should I do ?

@ploth
Copy link
Author

ploth commented Apr 9, 2019

You can try to install the 3.0.13 version which is working for me.

npm install electron@3.0.13

@lapineige
Copy link

Where should I run this command ?

@lapineige
Copy link

In fact it seems to be already 3.0.13…

@ploth
Copy link
Author

ploth commented Apr 11, 2019

Do you have the same error once I had?

@lapineige
Copy link

I have this:

Unhandled exception TypeError: app.makeSingleInstance is not a function
at Object. (/opt/Riot/resources/app/src/electron-main.js:103:24)
at Object. (/opt/Riot/resources/app/src/electron-main.js:277: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. (/opt/Riot/resources/electron.asar/browser/init.js:188:8)
at Object. (/opt/Riot/resources/electron.asar/browser/init.js:190:3)
at Module._compile (internal/modules/cjs/loader.js:693:30)

@lapineige
Copy link

Up.
Does someone know how to fix this ?
Even after some updates it doesn't work :(

@lapineige
Copy link

I found a solution.

For some reason, removing the package via apt didn't work. A part of the directory wasn't removed, even with purge command.
So I uninstalled the package, then removed /opt/Riot/, and installed it again.

It works :)

@gavv
Copy link

gavv commented Aug 19, 2019

Still reproducing for me.

I have run these commands:

git clone https://github.com/vector-im/riot-web.git
cd riot-web
yarn install
yarn build
yarn electron

And the output of the last one was:

yarn run v1.17.3
$ yarn install:electron && electron .
$ electron-builder install-app-deps
  • electron-builder version=20.44.4
  • loaded configuration file=package.json ("build" field)
  • installing production dependencies platform=linux arch=x64 appDir=/home/victor/dist/riot-web/electron_app

App threw an error during load
TypeError: protocol.registerSchemesAsPrivileged is not a function
    at Object.<anonymous> (/home/victor/dist/riot-web/electron_app/src/electron-main.js:238:10)
    at Object.<anonymous> (/home/victor/dist/riot-web/electron_app/src/electron-main.js:451:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at loadApplicationPackage (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:286:12)
    at Object.<anonymous> (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:327:5)
    at Object.<anonymous> (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:364:3)
Unhandled exception TypeError: protocol.registerSchemesAsPrivileged is not a function
    at Object.<anonymous> (/home/victor/dist/riot-web/electron_app/src/electron-main.js:238:10)
    at Object.<anonymous> (/home/victor/dist/riot-web/electron_app/src/electron-main.js:451:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at loadApplicationPackage (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:286:12)
    at Object.<anonymous> (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:327:5)
    at Object.<anonymous> (/usr/lib64/electron-3.1/resources/default_app.asar/main.js:364:3)
^C
electron --version
v3.1.8

Also tried electron 2.0.17 and got the same results.

@t3chguy
Copy link
Member

t3chguy commented Aug 19, 2019

Use electron 5 as documented in package.json

@gavv
Copy link

gavv commented Aug 19, 2019

@t3chguy thanks

I was (finally!) able to start riot by removing the system version of electron and installing the proper version via npm.

git clone https://github.com/vector-im/riot-web.git
cd riot-web
git checkout v1.3.2
cp config.sample.json config.json
yarn install
yarn build
npm install electron@5.0.7
yarn electron

su-ex added a commit to SchildiChat/element-web that referenced this issue Apr 1, 2022
* Live location sharing: live share warning in room ([\element-hq#8100](matrix-org/matrix-react-sdk#8100)).
* Add simple live share warning ([\element-hq#8066](matrix-org/matrix-react-sdk#8066)).
* extract reusable styled live beacon icon ([\element-hq#8103](matrix-org/matrix-react-sdk#8103)).
* Don't restore MemberInfo from RightPanel history when viewing a room ([\element-hq#8090](matrix-org/matrix-react-sdk#8090)). Fixes element-hq#21487.
* Allow sending files as replies as per MSC3676 ([\element-hq#8020](matrix-org/matrix-react-sdk#8020)). Fixes element-hq#7156.
* kill beacons on expiry ([\element-hq#8075](matrix-org/matrix-react-sdk#8075)).
* enable geolocation behaviour in location picker for live share type ([\element-hq#8068](matrix-org/matrix-react-sdk#8068)).
* Improve formatting features in the editor ([\#7104](matrix-org/matrix-react-sdk#7104)). Fixes element-hq#19501. Contributed by @alexanderstephan.
* Support MSC3026 busy presence ([\element-hq#8043](matrix-org/matrix-react-sdk#8043)).
* Show displayname in non-narrow thread summeries ([\element-hq#8036](matrix-org/matrix-react-sdk#8036)). Fixes element-hq#19646.
* Tweak search dialog based on new designs ([\element-hq#7980](matrix-org/matrix-react-sdk#7980)). Fixes element-hq#21285 and element-hq#21289.
* fallback to event text in location body when map unavailable ([\element-hq#7982](matrix-org/matrix-react-sdk#7982)). Fixes element-hq#20655.
* Send pin drop location share events ([\#7967](matrix-org/matrix-react-sdk#7967)).
* fix quicktime video thumbnailing ([\element-hq#8108](matrix-org/matrix-react-sdk#8108)). Fixes element-hq#21505.
* Fix scroll behaviour in space panel ([\element-hq#8111](matrix-org/matrix-react-sdk#8111)). Fixes element-hq#21467.
* Fix emoting with emoji or pills ([\element-hq#8105](matrix-org/matrix-react-sdk#8105)). Fixes element-hq#21497.
* Remove padding of InviteDialog & fix visual regression ([\element-hq#8076](matrix-org/matrix-react-sdk#8076)). Fixes element-hq#20631. Contributed by @luixxiul.
* Fixes mx_MLocationBody_markerBorder ([\element-hq#8069](matrix-org/matrix-react-sdk#8069)). Fixes element-hq#21444. Contributed by @luixxiul.
* Make margin and padding of mx_InviteDialog_other consistent ([\#8063](matrix-org/matrix-react-sdk#8063)). Fixes element-hq#20631. Contributed by @luixxiul.
* Fix freeze/crash when 1:1 calling ([\element-hq#8057](matrix-org/matrix-react-sdk#8057)). Fixes element-hq#21181.
* Don't assume that widget IDs are unique ([\#8052](matrix-org/matrix-react-sdk#8052)). Fixes element-hq#21399.
* Fix the header of Space landing page ([\element-hq#8048](matrix-org/matrix-react-sdk#8048)). Fixes element-hq#21402. Contributed by @luixxiul.
* Fix buttons alignment of Space list header ([\element-hq#8047](matrix-org/matrix-react-sdk#8047)). Fixes element-hq#21401. Contributed by @luixxiul.
* Fix null-guarding regression around reply_to_event dispatch ([\element-hq#8039](matrix-org/matrix-react-sdk#8039)).
* Fix clicking on copy link to thread wrongly opening thread ([\element-hq#8038](matrix-org/matrix-react-sdk#8038)). Fixes element-hq#20653.
* Fix regression around replying to search results ([\element-hq#8035](matrix-org/matrix-react-sdk#8035)). Fixes element-hq#21389.
* Share shared history keys in the background ([\element-hq#8031](matrix-org/matrix-react-sdk#8031)). Fixes element-hq#21192.
* Paginate responses to pinned polls ([\element-hq#8025](matrix-org/matrix-react-sdk#8025)). Fixes element-hq#21382.
* Fix incorrect usage of unstable variant of `is_falling_back` ([\element-hq#8016](matrix-org/matrix-react-sdk#8016)).
* Fix issues with ThreadSummary in msc-enabled mode ([\element-hq#8018](matrix-org/matrix-react-sdk#8018)). Fixes matrix-org/element-web-rageshakes#11401 and matrix-org/element-web-rageshakes#11400.
* Fix alignment of polls within threads ([\element-hq#8017](matrix-org/matrix-react-sdk#8017)). Fixes element-hq#21235.
* Fix issues with thread summaries being wrong or stale ([\element-hq#8015](matrix-org/matrix-react-sdk#8015)). Fixes element-hq#21363 and element-hq#21204.
* Fix button border color of LeaveSpaceDialog ([\element-hq#8010](matrix-org/matrix-react-sdk#8010)). Fixes element-hq#21365. Contributed by @luixxiul.
* Fix room list scroll jumps ([\element-hq#7991](matrix-org/matrix-react-sdk#7991)). Fixes element-hq#19322.
* Fix a variety of issues with HTML → Markdown conversion ([\element-hq#8004](matrix-org/matrix-react-sdk#8004)). Fixes element-hq#10648, element-hq#20718, element-hq#10722, element-hq#10389, element-hq#17610 element-hq#9984 and element-hq#20140.
* Wrap EventTile rather than its children in an error boundary ([\element-hq#7945](matrix-org/matrix-react-sdk#7945)).
* Normalized shortcut formatting for quote expansion control ([\element-hq#7995](matrix-org/matrix-react-sdk#7995)). Fixes element-hq#19685. Contributed by @Sinharitik589.
* Fix buttons and text layout on Security Key dialog ([\element-hq#7996](matrix-org/matrix-react-sdk#7996)). Fixes element-hq#21330. Contributed by @luixxiul.
* Fix formatting not being applied after links ([\element-hq#7990](matrix-org/matrix-react-sdk#7990)). Fixes element-hq#20091.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants