Skip to content

[Bug?]: node --watch does not detect changes in workspaces that have peer dependenciesΒ #6871

@dobesv

Description

@dobesv

Self-service

  • I'd be willing to implement a fix

Describe the bug

We use node --watch for some processes so they restart if a file changes. We have a monorepo setup. We noticed that if a package has peer dependencies, node does not detect changes to files in that package.

To reproduce

  1. Create a monorepo with two packages, and one depends on the other
  2. The first package should have at least one peer dependency
  3. Have a script in the second which imports something from the first, and runs forever (e.g. an HTTP server)
  4. Run the script
  5. Change the file in the other workspace
  6. Notice whether node detects the change restarts the process

Environment

System:
    OS: Linux 6.8 Linux Mint 22.1 (Xia)
    CPU: (24) x64 AMD Ryzen 9 7900X3D 12-Core Processor
  Binaries:
    Node: 24.4.1 - /tmp/xfs-e270292d/node
    Yarn: 4.9.2 - /tmp/xfs-e270292d/yarn
    npm: 11.4.2 - ~/.nvm/versions/node/v24.4.1/bin/npm

Additional context

It would be nice if the workspaces didn't use virtual paths somehow, maybe an option to disable that?

In general the virtual paths and multiple instances of dependencies cause us a lot of headaches, it would be nice to have a version of the pnp linker, or an option for it, that disables this behavior completely but still has the other advantages of pnp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions