Skip to content

ensureWatchedFile false positive on windows #20956

@mrginglymus

Description

@mrginglymus

Describe the bug

!file.startsWith(withTrailingSlash(root)) &&

Whilst investigating Yarn PnP issues, I noticed that ensureWatchedFile is sometimes called with windows paths, and sometimes with posix paths.

When called with windows paths, this line is guaranteed to return true (as root is always a posix path) and so some files may be unnecessarily added to the watcher.

Reproduction

!file.startsWith(withTrailingSlash(root)) &&

Steps to reproduce

No response

System Info

-

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions