Element-web: Fails to start with Electron 5.x

Created on 25 Apr 2019  Â·  5Comments  Â·  Source: vector-im/element-web

Description

When trying to start riot-desktop with Electron 5.x I get this:

App threw an error during load
TypeError: protocol.registerStandardSchemes is not a function
    at Object.<anonymous> (/usr/lib/riot/electron_app/src/electron-main.js:209:10)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
    at Module.load (internal/modules/cjs/loader.js:677:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
    at Function.Module._load (internal/modules/cjs/loader.js:601:3)
    at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:105:12)
    at Object.<anonymous> (/usr/lib/electron/resources/default_app.asar/main.js:153:5)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
Unhandled exception TypeError: protocol.registerStandardSchemes is not a function
    at Object.<anonymous> (/usr/lib/riot/electron_app/src/electron-main.js:209:10)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
    at Module.load (internal/modules/cjs/loader.js:677:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
    at Function.Module._load (internal/modules/cjs/loader.js:601:3)
    at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:105:12)
    at Object.<anonymous> (/usr/lib/electron/resources/default_app.asar/main.js:153:5)
    at Module._compile (internal/modules/cjs/loader.js:808:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)

Steps to reproduce

  • Build and launch (or just launch if using external electron) riot-desktop with electron 5.x in a terminal.

Version information

  • Platform: desktop
  • OS: Arch Linux
  • Version: 1.0.8
maintenance

Most helpful comment

I got around this by using registerSchemesAsPrivileged instead of registerStandardSchemes.

protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { standard: true, secure: true, supportFetchAPI: true } }]);

All 5 comments

This is broadly speaking "expected": it's related to a breaking change in Electron 5, so we'll need to change this bit when upgrading.

@uhoreg Thanks, this patch works. :)

I'am having the same issue on macOS Mojave "App threw an error during load
TypeError: protocol.registerStandardSchemes is not a function"
I applied @uhoreg 's patch and running the desktop with yarn 'yarn electron' works but when a build the app install and start it ....the main window does not open.....Is there a way to debug this...? Because the main window did not open I do not have access to the dev tools...

I got around this by using registerSchemesAsPrivileged instead of registerStandardSchemes.

protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { standard: true, secure: true, supportFetchAPI: true } }]);

Was this page helpful?
0 / 5 - 0 ratings

Related issues

t3chguy picture t3chguy  Â·  3Comments

turt2live picture turt2live  Â·  3Comments

grahamperrin picture grahamperrin  Â·  3Comments

MurzNN picture MurzNN  Â·  3Comments

richvdh picture richvdh  Â·  3Comments