TypeError: Cannot read properties of undefined (reading 'members')
See original GitHub issueAfter 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:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doc should also mention needing the remote npm dependency: “devDependencies”: { “electron”: “14.0.0”, “@electron/remote”: “2.0.1” }
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.