sindresorhus / electron-debug

Adds useful debug features to your Electron app
MIT License
749 stars 49 forks source link

debug\index.js:74 Uncaught TypeError: Cannot read property 'on' of undefined #63

Open juancresc opened 6 years ago

juancresc commented 6 years ago

Issuehunt badges

I'm getting an error with versions:

`-- electron@1.8.4
`-- electron-debug@1.5.0

Initialize code:

const {app, BrowserWindow} = require('electron');
require('electron-debug')({showDevTools: true});
let win;
app.on('ready', () => {
    win = new BrowserWindow();
});

Error trace:


C:\Users\Administracion\Desktop\manu\Sistemas\recargas_ussd\node_modules\electron-debug\index.js:74 Uncaught TypeError: Cannot read property 'on' of undefined
    at module.exports.opts (C:\Users\Administracion\Desktop\manu\Sistemas\recargas_ussd\node_modules\electron-debug\index.js:74:5)
    at file:///C:/Users/Administracion/Desktop/manu/Sistemas/recargas_ussd/assets/js/script.js:22:26]

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

sindresorhus commented 6 years ago

Do you still see this with Electron 2.0.2?

daniel-kun commented 6 years ago

@sindresorhus Jup! I still see it in Electron 2.0.2, Node v8.11.2, Windows. Additional info: I use electron-compile to be able to use ES6, maybe this is related.

afhammad commented 6 years ago

+1

hasparus commented 5 years ago

I have the same problem:

> cross-env HOT=1 NODE_ENV=development electron ./app/main.development

D:\Git\heck\node_modules\electron-debug\index.js:74
        app.on('browser-window-created', (e, win) => {
           ^

TypeError: Cannot read property 'on' of undefined
    at module.exports.opts (D:\Git\heck\node_modules\electron-debug\index.js:74:5)
    at Object.<anonymous> (D:\Git\heck\heck-app\app\main.development.js:13:28)
    at Object.<anonymous> (D:\Git\heck\heck-app\app\main.development.js:274:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:167:16)
IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.