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

185
Views
Cannot get property of undefined browser window

When running electron 13.1.X and above I get the error - menuHandler.js:8 Uncaught TypeError: Cannot read properties of undefined (reading 'getBrowserWindow').

code from main.js

const { electron, app, Notification, ipcMain } = require('electron');
var Path = require('path');
var url = require('url');
const { BrowserWindow } = require('electron');

The error occurs from menuHandler.js:8

const { remote } = require("electron");
const Window = remote.getBrowserWindow();

And so, I can't use the function:

$("#minimize").click(function() {
Window.minimize();

});

Here it throws an error passing the above message, meanwhile it works fine on older versions of electron. Please how can I fix this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Remote was removed from the main electron package, you have to install @electron/remote on your project.

To use this new electron remote add this to your main file:

require('@electron/remote/main').initialize();
const { BrowserWindow } = require('electron');
const window = new Browser window();
require("@electron/remote/main").enable(window.webContents);

On your renderer:

const { BrowserWindow } = require('@electron/remote');

Readme of the new remote module: https://github.com/electron/remote#migrating-from-remote

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!