TypeError: ipc.on is not a function


#1

and my code:

var ipc = nodeRequire('ipc');

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

pickerAddEl.addEventListener('click', function (e) {
	ipc.send('page-picker-add');
});

and show error:

TypeError: ipc.send is not a function

I am sorry, my English is not good


#2

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')


#4

thank !My problem has been solved