Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchman required with 2.0.0 when not watching files. #2617

Open
sheki opened this issue Jan 28, 2019 · 8 comments
Open

Watchman required with 2.0.0 when not watching files. #2617

sheki opened this issue Jan 28, 2019 · 8 comments

Comments

@sheki
Copy link
Contributor

sheki commented Jan 28, 2019

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.
@sibelius
Copy link
Contributor

you can disable watchman, check

relay-compiler --watchman false

@sheki
Copy link
Contributor Author

sheki commented Jan 28, 2019

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.

@alloy
Copy link
Contributor

alloy commented Jan 29, 2019

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?

kmjennison added a commit to gladly-team/tab that referenced this issue Jan 29, 2019
@m4rcelofs
Copy link

m4rcelofs commented Feb 7, 2019

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?

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.

@jstejada
Copy link
Contributor

jstejada commented Feb 8, 2019

Yeah, we should at least update the docs, thanks for pointing that out!
cc @alunyov

@alunyov
Copy link
Contributor

alunyov commented Feb 10, 2019

I think I have a fix for that: #2643

facebook-github-bot pushed a commit that referenced this issue Feb 28, 2019
Summary:
Here is an updated version of the `GraphQLWatchmanClient.isAvailable`. (as a fix for #2617)

Now, it's also checking if the `watchman` CLI is available.

Test plan (Tested with `relay-examples:relay-publish-test`  (relayjs/relay-examples#89)

First of all, I've removed watchman from my machine.
Then,
  - Build the compiler
  - Install updated dependencies relay-examples (yarn)
  - Run the compiler (yarn build)

Compiled without errors.
Pull Request resolved: #2643

Reviewed By: kassens

Differential Revision: D14240611

Pulled By: alunyov

fbshipit-source-id: 551a9338158debe7db8748676a6dccf0dfd479b0
@stale
Copy link

stale bot commented Dec 25, 2020

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.

@stale stale bot added the wontfix label Dec 25, 2020
@MattKleinsmith
Copy link
Contributor

MattKleinsmith commented Feb 14, 2023

Hello from 2023,

I needed to remove --watch from "watch-relay": "relay-compiler --watch", in relay-examples/newsfeed/package.json to get npm run dev to work with the tutorial.

I might need to re-run npm run dev each time I make a change to a fragment/query. At least the data is loading from GraphQL now, though.


Edit:

Installed Watchman. Wanted the watch feature.

@stale stale bot removed the wontfix label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants