You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--watch mode disables IPC communication between a spawning process and the actual child process #50880
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
I expect to be able to communicate with a spawned child process, even when using --watch.
What do you see instead?
Because the --watch mode uses IPC itself (to listen to messages from the child process) it doesn't pass through messages from the child to the parent, or the parent to the child.
Additional information
As I said, this isn't quite a bug - but not quite a feature request either. I believe the fix is relatively simple, if the process has IPC enabled, then pass through messages (that aren't watch related) from the child -> parent and all messages from parent -> child
Ok, it turns out the fix is extremely simple, I'm happy to open a PR for this, I'm just not sure how to go about testing it. I think it's probably fine to require the parent process filter out unrelated (e.g., messages with watch: prefixed keys) IPC messages.
Activity
znewsham commentedon Nov 23, 2023
Ok, it turns out the fix is extremely simple, I'm happy to open a PR for this, I'm just not sure how to go about testing it. I think it's probably fine to require the parent process filter out unrelated (e.g., messages with
watch:prefixed keys) IPC messages.in 'lib/internal/files_watcher.js', add:
then modify
constructorto have:then modify
watchChildProcessModulesto have:znewsham commentedon Nov 23, 2023
@MoLow not sure what your thoughts are on this
MoLow commentedon Nov 23, 2023
Sound like a great solution,
for testing I would just add an extra case to https://github.com/nodejs/node/blob/main/test/sequential/test-watch-mode.mjs
with a fixture printing messages, validating it receives messages
Fixes nodejs#50880 - enable passthrough IPC in watch mode