Breaking change in Electron ugh
by davewiner Saturday, May 28, 2016

I'm still putting the pieces back from the disk crash that happened earlier in May. The rainbow cursor mess. 

The other day I wanted to do some work with Electron. 

There's an Electron version of the 1999.io app. 

I wanted to have another look at that, and another project I'm working on that's also Electron-based.

So I needed to reinstall Electron. So I did. And nothing worked.

Now the question is, did I do something weird when I last installed Electron that I'm now forgetting. I looked back over my notes. Nothing obvious.

So I waited for a fresh start, and sat down with a nice glass of iced coffee, and set about figuring out what was wrong.

I'll save all the blind alleys and wrong guesses.

Two things changed. 

  1. I call crashReporter at the beginning of my main routine. I do it because all the example code does it. Amazingly this was causing the first crash. Apparently this (now?) requires a companyName value be set somewhere. I read somewhere that you could just take it out, so I did, and now my apps got a lot further.
  2. One of them opens a dialog. It was failing. On investigation I found the call to find the remote module was failing. I found another way to do it, and that worked but then it failed on the call to the dialog module. 

Now, instead of this:

var remote = require ("remote");

var dialog = remote.require ("dialog"); 

You now say:

var remote = require ("electron").remote;

var dialog = remote.dialog; 

Apparently I had an older version of Electron and there was a breaking change in an intervening version. I hate it when that happens. Look away for awhile and your app breaks in mysterious ways. Oy.

Anyway now it's documented. ;-)