electron-window-state icon indicating copy to clipboard operation
electron-window-state copied to clipboard

TypeError: Cannot read property 'screen' of undefined

Open Feverqwe opened this issue 7 years ago • 2 comments

In main process variable electron.screen sometimes is null on mac. At this line you try get screen from remote, that is undefined. https://github.com/mawie81/electron-window-state/blob/e76fe1e006af5eb496e7f66194f3eaadcf4bfc77/index.js#L11

Feverqwe avatar Nov 17 '17 16:11 Feverqwe

I also have this in mac, in my case in the built app (using "electron-builder": "19.10.0"). It seems to only happen the first time I try to open the app. After that it works.

dbuezas avatar Nov 27 '17 12:11 dbuezas

I just noticed that this error occurs when opening the application multiple times subsequently on two monitors. As soon as I launch the app successfully on a single monitor, I can reconnect my second monitor and relaunch the app successfully. As with the previous two reports, this is on OS X, resolved "https://registry.yarnpkg.com/electron-window-state/-/electron-window-state-4.1.1.tgz#6b34fdc31b38514dfec8b7c8f7b5d4addb67632d".

I haven't tried to figure out deleting what build files / runtime files / caches make the bug recur.

confiks avatar Mar 01 '18 08:03 confiks