Cannot read properties of undefined (reading 'ipcRenderer')

See original GitHub issue

Prerequisites

  • [ YES] Using npm
  • [ YES] Using an up-to-date main branch
  • [ YES] Using latest version of devtools. Check the docs for how to update
  • [ NO] Tried solutions mentioned in #400
  • [ NO] For issue in production release, add devtools output of DEBUG_PROD=true npm run build && npm start

Expected Behavior

Current Behavior

Call Stack
 Object../src/renderer/index.tsx
  renderer.dev.js:68966:17
 Object.options.factory
  renderer.dev.js:73907:31
 __webpack_require__
  renderer.dev.js:73352:33
 undefined
  renderer.dev.js:74489:37
 undefined
  renderer.dev.js:74492:12
 webpackUniversalModuleDefinition
  renderer.dev.js:7:11
 undefined
  renderer.dev.js:10:3

Steps to Reproduce

  1. git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name

  2. then npm i and npm start

  3. it shows error above

Possible Solution (Not obligatory)

Context

Your Environment

  • Node version : 14.17.0
  • electron-react-boilerplate version or branch : main
  • Operating System and version : macOS
  • Link to your project : -

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:12

github_iconTop GitHub Comments

4reactions
GasperFundacommented, May 2, 2022

Please fix this I am facing the same issue when I tried to follow the tutorial on adding native modules to electron app with your boilerplate: https://electron-react-boilerplate.js.org/docs/native-modules/

2reactions
rezol99commented, Aug 18, 2022

I commented out the following example and it fixed it.

I don’t know why.

src/renderer/index.tsx

import { createRoot } from 'react-dom/client';
import App from './App';

const container = document.getElementById('root')!;
const root = createRoot(container);
root.render(<App />);

// window.electron.ipcRenderer.once('ipc-example', (arg) => {
//   console.log(arg);
// });
// window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);
Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting an error when using ipcRenderer (typeerror ...
I am getting an error when using ipcRenderer (typeerror cannot read properties of undefined (reading 'send')) · Ask Question. Asked 7 months ago....
Read more >
cannot read properties of undefined (reading 'ipcrenderer')
To solve the "Cannot read properties of undefined" error, make sure to insert the JS script tag at the bottom of the body....
Read more >
Electron - Uncaught TypeError: Cannot read properties of ...
Coding example for the question Electron - Uncaught TypeError: Cannot read properties of undefined (reading 'showOpenDialog')-node.js.
Read more >
[HELP] Cannot send data from HTML to main process using ...
Cannot read properties of undefined (reading 'send'). within console. Here is my code: var {ipcRenderer} = require('electron'); ...
Read more >
ipcRenderer - Electron
The ipcRenderer module has the following method to listen for events and send ... such objects cannot be sent over Electron's IPC to...
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