We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*mac OS M1, ts-node-dev@2.0.0
parent.js `const path = require('path'); const { fork } = require('child_process');
const forked = fork(path.join(__dirname, './child.js'));
forked.on('message', (msg) => { console.log('Message from child', msg); });
forked.send({ hello: 'world' });`
child.js `process.on('message', (msg) => { console.log('Message from parent:', msg); });
let counter = 0;
setInterval(() => { process.send({ counter: counter++ }); }, 1000); `
ts-node-dev --respawn --rs parent.js
The text was updated successfully, but these errors were encountered:
I've had this issue too Your example reproduces the issue very well The --fork flag does not seem to help: ts-node-dev --respawn --rs --fork parent.js
--fork
ts-node-dev --respawn --rs --fork parent.js
Trying to learn about the child process system but it's quite tricky indeed 😅
Sorry, something went wrong.
No branches or pull requests
Issue description
Context
*mac OS M1, ts-node-dev@2.0.0
parent.js
`const path = require('path');
const { fork } = require('child_process');
const forked = fork(path.join(__dirname, './child.js'));
forked.on('message', (msg) => {
console.log('Message from child', msg);
});
forked.send({ hello: 'world' });`
child.js
`process.on('message', (msg) => {
console.log('Message from parent:', msg);
});
let counter = 0;
setInterval(() => {
process.send({ counter: counter++ });
}, 1000);
`
ts-node-dev --respawn --rs parent.js
The text was updated successfully, but these errors were encountered: