question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read properties of undefined (reading 'members')

See original GitHub issue

After upgrade to remote v2.0.1 (electron v14.0.1) I can’t use the remote module in the renderer process. The line and where the error comes from the renderer file:

const { dialog } = require("@electron/remote");

Main process:

const { app, BrowserWindow } = require("electron");
const remoteMain = require("@electron/remote/main");
const win = new BrowserWindow({ ... });
remoteMain.enable(win.webContents);
win.loadFile("./build/web/index.html");

Everything was working fine before the upgrade.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Nashorncommented, Sep 17, 2021

Doc should also mention needing the remote npm dependency: “devDependencies”: { “electron”: “14.0.0”, “@electron/remote”: “2.0.1” }

0reactions
hattoncommented, Oct 2, 2022

For me, after carefully doing the above, remote was still undefined in the render process. My error was dumb:

import remote from "@electron/remote";

Instead, I needed import * as remote from "@electron/remote";

or const remote require("@electron/remote")

Normally the typescript type system would squawk at a problem like this, so maybe this is just something weird in my setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'members')
I get this error every time: name: `${guild.members.filter(member => !member.user.bot).size} users!` ^ TypeError: Cannot read properties of ...
Read more >
Cannot read property 'members' of undefined - Glitch Support
I'm trying to kind of make a ,kill command for a discord bot. Every time I try and run it, it comes out...
Read more >
Cannot read properties of undefined (reading 'member') - Reddit
Your error is indicating that the message variable has the value undefined , and you cannot do undefined.member because undefined doesn't have a ......
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
cannot read properties of undefined (reading 'roles') - You.com
The "Cannot read properties of undefined" error occurs when you try to access a property or method on a variable that stores an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found