Skip to content

Watch mode not triggered by worker module and dependencies #62275

@clemyan

Description

@clemyan

Version

v24.14.0, v25.8.1

Platform

- Microsoft Windows NT 10.0.19045.0 x64
- Linux <host> 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

When running a script that creates a Worker under watch mode, modifying the worker module and its dependencies does not trigger a restart

// main.mjs
import {Worker} from 'node:worker_threads';
new Worker('./worker.mjs').on('message', console.log);

// worker.mjs
import {parentPort} from 'node:worker_threads';
parentPort.postMessage(Date.now());
$ node --watch main.mjs

# In another shell sesssion
$ touch worker.mjs # does not trigger restart
$ touch main.mjs # triggers restart

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Modifying the worker module (or its dependencies) triggers a restart under watch mode

What do you see instead?

Modifying the worker module (or its dependencies) does not trigger a restart under watch mode

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions