NWJS Version : 0.27.4
Node Version : 9.3.0
Operating System : Windows 7
Message traffic between parent and spawned child should continue uninterrupted
Verified expected behavior with - NWJS Version : 0.19.4, Node Version : 7.2.0
The spawned child process exits with error code: 3221225477
Run the following code with a helloWorld.html of your choice.
{
"name": "scratch",
"version": "0.0.1",
"main": "index.js"
}
`
const path = require('path');
const gui = require('nw.gui');
const spawn = require('child_process').spawn;
gui.Window.open('helloWorld.html', {}, function(win) {});
//Create spawned process
var child = spawn(process.execPath, ['./child.js'], {
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
execPath: process.execPath
});
//Message sent back from child
child.on('message', function(m) {
console.log('[Child message] ' + m.msg);
});
//Continually send messages to child (simulates typical IPC traffic)
setInterval(function() {
console.log('ping')
child.send('ping');
}, 50);
process.on('uncaughtException', function (err) {
console.error(err);
});
`
`
//Respond to pings with pongs
process.on('message', function(m) {
setTimeout(function() {
//Add a little bit of print litter to stdout to speed up the errors
process.stdout.write('stdout111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111');
process.send({msg: 'pong'});
});
});
`
I tried it on Windows 8.1 with nwjs-sdk-v0.27.4, child process stopped and an error occurred:

This doesn't happen on Linux with nwjs-sdk-v0.27.4.
I am running into the same issue in an application with multiple spawned processes. The application is currently unusable with the same upgrade as the OP. I'm also on Windows 7 as well.
Not sure if this is related, but I'm using the fork command to spawn a nodejs process and it seems to die immediately on Windows 10 using NW.js 0.27.5.
The only error that prints out is events.js:136 Uncaught NodeError: Channel closed when I try to send a message to the process.
When running with NW.js 0.26.6 it works fine.
Yeah this seems to be a regression in 0.27
This is fixed in git and will be available in the next nightly build.
Thanks, that 28.1 build appears to be working in my case.
That worked for my original issue. Thank you for addressing it so quickly.
Most helpful comment
This is fixed in git and will be available in the next nightly build.