Skip to content
Advertisement

How to solve TypeError: Cannot read property ‘send’ of undefined in app.on

I have an error:

TypeError: Cannot read propety ‘send’ of undefind on start of my program. How to correctly trigger app.on without errors?

JavaScript

Advertisement

Answer

I feel like this is probably a dupe of another question, but ipcRenderer cannot be used in the main process. See the docs which say:

Process: Renderer

If you want to send a message from the main process to the main process, you can use ipcMain.emit, or just call the function directly. Why send messages in this case?

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement