When running a non watch command like
relay-compiler --schema ./webpack/assets/javascripts/relay/schema.json --extensions js jsx --src ./webpack in relay 2.0.0, the lack of watchman on the system fails the build.
This was not the case with relay 1.7.x. Our CI builds now need watchman. Watchman does not come with prebuilt packages and its not something I want to add to our build.
Is there a chance that this is a regression with 2.0.0
relay-compiler --schema ./webpack/assets/javascripts/relay/schema.json --extensions js jsx --src ./webpack
Watchman: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions
HINT: pass --watch to keep watching for changes.
Writing js
Unchanged: 476 files
Watchman: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions
events.js:183
throw er; // Unhandled 'error' event
^
Error: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
you can disable watchman, check https://github.com/facebook/relay/blob/708f842c30e3cbb709a6b516002529b7de11dfe3/packages/relay-compiler/bin/RelayCompilerMain.js#L135
relay-compiler --watchman false
Thanks for the workaround
The option should be opt in instead of opt-out.
"relay-compiler": "relay-compiler --schema ./webpack/assets/javascripts/relay/schema.json --extensions js jsx --src ./webpack"
I would have to now add two versions of this command, which more than a minor annoyance.
Consider changing the default for the option.
I don't think it should just be disabled by default, but it _should_ only be enabled when --watch is enabled imo. @sheki Care to create a PR for that?
I don't think it should just be disabled by default, but it _should_ only be enabled when
--watchis enabled imo. @sheki Care to create a PR for that?
The Quick Start Guide indicates that watchman is an optional dependency, so throwing an error when just following the tutorial-provided command seems... weird, indeed.
Yeah, we should at least update the docs, thanks for pointing that out!
cc @alunyov
I think I have a fix for that: https://github.com/facebook/relay/pull/2643
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
you can disable watchman, check https://github.com/facebook/relay/blob/708f842c30e3cbb709a6b516002529b7de11dfe3/packages/relay-compiler/bin/RelayCompilerMain.js#L135
relay-compiler --watchman false