TypeError: ipc.on is not a function


and my code:

var ipc = nodeRequire('ipc');

var pickerAddEl = document.querySelector('#picker_add');

pickerAddEl.addEventListener('click', function (e) {

and show error:

TypeError: ipc.send is not a function

I am sorry, my English is not good


The IPC API has changed slightly a while back, I suggest you take a look at the API docs. In the renderer process you should use:

const { ipcRenderer } = nodeRequire('electron')


thank !My problem has been solved