Skip to content

watch: NODE_OPTIONS filter misses underscore aliases like --watch_path, causing recursive spawning #66364

Description

@trivikr

Version

main

Platform

All

Subsystem

watch

What steps will reproduce the bug?

printf 'console.log("APP-EXECUTED");\n' > app.js
NODE_OPTIONS='--watch_path=./' node app.js

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

Always

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

The child spawned by watch mode should have the watch flags stripped from NODE_OPTIONS, exactly as the dash spelling is. --watch-path=./ prints APP-EXECUTED then Completed running 'app.js'. Waiting for file changes... and settles at one process.

The C++ layer treats _ and - as equivalent in option names, so the two spellings must not differ in behavior.

What do you see instead?

No output at all; the application never executes. Each descendant re-enters watch mode and spawns another

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    watch-modeIssues and PRs related to watch mode.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions