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.

Cant read property 'on' on undefined

See original GitHub issue

Hi, I am using your updater and I have problem when I import it, it can’t ready properto ‘on’ on undefined on line 35 of index.js.

I was able to fix it by including autoupdater like this:

const electron =  require('electron');
const app = electron.remote.app;
const autoUpdater = electron.remote.autoUpdater;

But I would like to know if this is my issue or issue of library. Am I doing something wrong? I have my electron 1.4.7 in devDependecies of project and I don’t have it installed globally.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
megahertzcommented, Jan 5, 2017

It seems that you import electron-simple-updater in the renderer process directly. If you would like to use this library from renderer process you should import it like this: const { remote } = require(‘electron’); const updater = remote.require(‘electron-simple-updater’);

0reactions
megahertzcommented, Apr 6, 2018

@uvlek what do you mean? This package calls checkForUpdates of built-in electron module internally

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving TypeError: Cannot Read Property of Undefined ...
What Causes TypeError: Cannot Read Property of Undefined. Undefined means that a variable has been declared but has not been assigned a value....
Read more >
Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >
Node.js Cannot read property 'on' of undefined
My server.js code : var events = require('events').EventEmitter; var v = function() ...
Read more >
Uncaught TypeError : Cannot read properties of undefined
The solution to TypeError: Cannot read properties of undefined ... The root cause of the error is that the declared variable doesn't have...
Read more >
How to Avoid the Infamous "Cannot read properties of ...
Interpreting undefined or null as subtypes of all other types can lead to runtime problems. For example, if you try to get the...
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