electron: Node IPC not working after spawning Electron with empty env
I’m unable to make a simple IPC communication between node and spawned electron process working on linux ubuntu. It works fine on Windows.
node.js code
var electron = require('electron-prebuilt')
var spawn = require('child_process').spawn
var child = spawn(electron, ['electron-script.js'], {
stdio: ['ipc']
})
child.on('message', function (m) {
console.log('Yes it works!')
})
electron script
process.send('I am ok')
process.exit(0);
On windows I get back Yes it works! to console. There seems to be no communication happening and nothing is printed on ubuntu. Thank you for the help.
- Electron version: ~ 1.3.1
- Operating system: Ubuntu
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
This doesn’t seem to happen if you leave DISPLAY set.
That seems to be well documented in docs/tutorial/testing-on-headless-ci.md.
hmm i’m not sure that is true, i’ve provided an example that shows the bug, it is short to try it, and it was even confirmed by another member in the electron team.
however i will try electron v2 and see if the bug is still there
We haven’t gotten a response to our questions in the comment above. With only the information that is currently in the issue, we don’t have enough information to take action. In this event, i’m going to go ahead and close this but can reopen should you follow up with more info!
@zcbenz shouldn’t the label be
linuxinstead ofosx?