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.
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:
Doesn't work ONLY with enabled node.js imports.