wulkano / Kap

An open-source screen recorder built with web technology
https://getkap.co
MIT License
17.92k stars 818 forks source link

Error: The 'screen' module can't be used before the app 'ready' event #891

Open sentry-io[bot] opened 4 years ago

sentry-io[bot] commented 4 years ago

Sentry Issue: KAP-7AN

Error: The 'screen' module can't be used before the app 'ready' event
  File "app:///main/cropper.js", line 20, in closeAllCroppers
    screen.removeAllListeners('display-removed');
  File "app:///main/preferences.js", line 16, in openPrefsWindow
    closeAllCroppers();
  File "app:///main/utils/deep-linking.js", line 22, in null.<anonymous>
    const triggerPluginAction = action => name => openPrefsWindow({target: {name, action}});
  File "app:///main/utils/deep-linking.js", line 34, in handleDeepLink
    return routes.get(host)(pathname.slice(1));
  File "app:///main/index.js", line 124, in App.<anonymous>
    handleDeepLink(url);
...
(5 additional frame(s) were not displayed)
sindresorhus commented 4 years ago

How could possibly closeAllCroppers be called before the app is ready? Makes no sense...

karaggeorge commented 4 years ago

Yeah.. so the deep link I guess happens before app is ready, the deep links opens the preferences window, which closes croppers before it's opened.

I can add a wait till app is ready in the deep link