Version: 15.1.0 thru 15.11.0 (see screenshot below)
Platform: Darwin CALLMT20389 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
What steps will reproduce the bug?
Run the following simple repro example:
parent.mjs
import { fork } from 'child_process';
const subprocess = fork('./child.mjs');
subprocess.on('close', (...args) => { console.error('[PARENT] received', ...args) });
subprocess.on('disconnect', (...args) => { console.error('[PARENT] received', ...args) });
subprocess.on('error', (...args) => { console.error('[PARENT] received', ...args) });
subprocess.on('exit', (...args) => { console.error('[PARENT] received', ...args) });
subprocess.on('message', (...args) => { console.log('[PARENT] received', ...args) });
subprocess.on('spawn', () => {
console.log({
'parent::subprocess.send': subprocess.send({ hello: 'child' })
});
});
child.mjs
process.on('message', (...args) => { console.log('[CHILD] received', ...args) });
process.send({ hello: 'parent' });
How often does it reproduce? Is there a required condition?
100% of the time (dozens of executions)
What is the expected behavior?
child's process.on('message') should be triggered (parent's message should be received and logged to console).
What do you see instead?
Only parent's subprocess.on('message') is triggered:
$> node ./parent.mjs
{ 'parent::subprocess.send': true }
[PARENT] received { hello: 'parent' }

Additional info
I installed node via nvm. I verified the version of node actually running is truly 15.11.0 by console logging process.version in both parent.mjs and child.mjs (both output v15.11.0)
Version:
15.1.0thru15.11.0(see screenshot below)Platform:
Darwin CALLMT20389 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64What steps will reproduce the bug?
Run the following simple repro example:
$> node ./parent.mjsparent.mjs
child.mjs
How often does it reproduce? Is there a required condition?
100% of the time (dozens of executions)
What is the expected behavior?
child's process.on('message') should be triggered (parent's message should be received and logged to console).
What do you see instead?
Only parent's subprocess.on('message') is triggered:
Additional info
I installed node via nvm. I verified the version of node actually running is truly 15.11.0 by console logging
process.versionin both parent.mjs and child.mjs (both outputv15.11.0)