Issuing a file query using backward-slashes as path separators like ["dirname", "app\src"] does not return any result, but using forward-slashes like ["dirname", "app/src"] does work as expected.
This issue is related to facebook/relay#4339: the Relay Compiler generates file queries of the form ["allof", ["dirname", "app\src"], ["suffix", "js"]] in order to find all source files in the project. The dirname value is generated from a Rust Path that uses the platform-specific path separator, so backward-slashes on Windows, which makes the compiler silently fail as Watchman does not return any source file matching the query. Normalizing all path separators to forward-slashes in Watchman queries fixes the issue for the Relay Compiler, but it might be a better solution to change this behavior at the Watchman level instead.
Issuing a file query using backward-slashes as path separators like
["dirname", "app\src"]
does not return any result, but using forward-slashes like["dirname", "app/src"]
does work as expected.This issue is related to facebook/relay#4339: the Relay Compiler generates file queries of the form
["allof", ["dirname", "app\src"], ["suffix", "js"]]
in order to find all source files in the project. Thedirname
value is generated from a RustPath
that uses the platform-specific path separator, so backward-slashes on Windows, which makes the compiler silently fail as Watchman does not return any source file matching the query. Normalizing all path separators to forward-slashes in Watchman queries fixes the issue for the Relay Compiler, but it might be a better solution to change this behavior at the Watchman level instead.