macOS : "A JavaScript error occurred in the main process" when starting
Open
jarlarntzen
opened this issue 8 years ago
•
8 comments
Operation System: macOS 10.13.2 (17C88) High Sierrra
Beaker Version: 0.7.10
When attempting to start the Beaker Browser, I get an error dialog:
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Cannot set property 'domain' of null
at EventEmitter.init (events.js:62:15)
at EventEmitter (events.js:27:21)
at Object. (/Applications/Beaker Browser.app/Contents/Resources/electron.asar/browser/api/screen.js:6:14)
at Object. (/Applications/Beaker Browser.app/Contents/Resources/electron.asar/browser/api/screen.js:10: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 Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.get [as screen] (/Applications/Beaker Browser.app/Contents/Resources/electron.asar/browser/api/exports/electron.js:11:16)
at getScreenAPI (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:1667:29)
at defaultState (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:1572:18)
at restoreState (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:1563:28)
at createShellWindow (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:1471:60)
at ensureOneWindowExists (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:1525:5)
at App.electron.app.on (/Applications/Beaker Browser.app/Contents/Resources/app.asar/background-process.build.js:5809:35)
at emitTwo (events.js:125:13)
at App.emit (events.js:213:7)
Turns out this was happening when the macOS 'activate' event fired. The screen API is only available after 'ready' and so what's probably happening is, 'activate' is getting fired before 'ready'. I'm adding guards in Beaker. We'll see if that solves it.