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 triggers unsolicided messages to Workers #65044
The behavior is identical when using an equivalent main.cjs instead.
How often does it reproduce? Is there a required condition?
reproduces consistently
What is the expected behavior? Why is that the expected behavior?
applications should not receive unexpected (and undocumented) messages by the engine.
What do you see instead?
Unsolicided "watch:require" messages are sent.
Additional information
This issue effects v24 and v26, as can be seen in the following log (tested with node.js v22.23.1, v23.11.1, v24.19.0, v25.9.0, v26.6.0; note that I aborted each run with ctrl+c)
$ docker run --rm -v .:/app -w /app node:22-alpine node --watch main.mjsCompleted running 'main.mjs'. Waiting for file changes before restarting...
$ docker run --rm -v .:/app -w /app node:23-alpine node --watch main.mjs Completed running 'main.mjs'
$ docker run --rm -v .:/app -w /app node:24-alpine node --watch main.mjs{ 'watch:require': [ '/app/worker.js' ] }Completed running 'main.mjs'. Waiting for file changes before restarting...
$ docker run --rm -v .:/app -w /app node:25-alpine node --watch main.mjsCompleted running 'main.mjs'. Waiting for file changes before restarting...
$ docker run --rm -v .:/app -w /app node:26-alpine node --watch main.mjs{ 'watch:require': [ '/app/worker.js' ] }Completed running 'main.mjs'. Waiting for file changes before restarting...
Though robust message handling code should always validate and check received messages, such unexpected messages can lead to unexpected behavior, e.g. crashes. This unexpected node.js behavior leads to the following issue downstream with an XML schema validating library: noppa/xmllint-wasm#37
Opened #65049 for this. Under --watch, each worker reports its dependencies over the message channel, and the main thread was forwarding those watch:require/watch:import messages to the watch supervisor but still emitting them to user worker.on('message') listeners. The fix consumes those internal messages instead of surfacing them, with a regression test.
Activity
bitpshr commentedon Aug 5, 2026
Opened #65049 for this. Under
--watch, each worker reports its dependencies over the message channel, and the main thread was forwarding thosewatch:require/watch:importmessages to the watch supervisor but still emitting them to userworker.on('message')listeners. The fix consumes those internal messages instead of surfacing them, with a regression test.fix(coding-agent): ignore Node's own worker messages in image resize
fix(coding-agent): ignore Node's own worker messages in image resize
fix(coding-agent): ignore Node's own worker messages in image resize
fix(codemode): ignore Node --watch notifications from the worker
fix(coding-agent): ignore Node's own worker messages in image resize
fix(codemode): ignore Node --watch notifications from the worker