-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
clusterIssues and PRs related to the cluster subsystem.Issues and PRs related to the cluster subsystem.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.
Description
Hi there.
I have a problem:
The Worker doesn't react on "message" event from the Primary with: type: "module" enabled in package.json
But the Primary is react on "message" event from the worker
Without type: "module" both works.
win10 x64 (node v14.17.5 and v16.7.0)
Guys, any fixes? Thanks.
Example:
import cluster from 'cluster';
if (cluster.isMaster) {
const worker = cluster.fork();
worker.on('message', message => {
// will log the message
console.log(message);
});
worker.send('From Master');
} else {
process.on('message', message => {
// will not log the message
console.log(message);
});
process.send('From Worker');
}
Doesn't work ONLY with enabled node.js imports.
Metadata
Metadata
Assignees
Labels
clusterIssues and PRs related to the cluster subsystem.Issues and PRs related to the cluster subsystem.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.