Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
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?

import * as electron from "electron";
const {app, BrowserWindow,ipcRenderer,ipcMain} = electron;

var correspondingWindow = null;
let mainWindow;

ipcMain.on('newWindow', function (e, category) {

//some code with switch Window_1
 
});

app.on('ready', function () {
  "use strict";
  ipcRenderer.send('newWindow', 'Window_1');
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!