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 fails if there is no .git in the directory #802

Closed
aaronabramov opened this issue Mar 15, 2016 · 6 comments
Closed

watchman fails if there is no .git in the directory #802

aaronabramov opened this issue Mar 15, 2016 · 6 comments

Comments

@aaronabramov
Copy link
Contributor

~/testing master* ࿘  jest
Using Jest CLI v0.9.2, jasmine2
 PASS  __tests__/test-test.js (0.014s)
1 test passed (1 total in 1 test suite, run time 0.381s)


~/testing master* ࿘  rm -rf .git


~/testing ࿘  jest
Using Jest CLI v0.9.2, jasmine2
Error: Failed to build DependencyGraph: Watchman error: query failed: synchronization failed: No such file or directory. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
This is most likely a setup or configuration issue. To resolve a module name collision, change or blacklist one of the offending modules. See http://facebook.github.io/jest/docs/api.html#config-modulepathignorepatterns-array-string


~/testing ࿘  jest --no-watchman
Using Jest CLI v0.9.2, jasmine2
 PASS  __tests__/test-test.js (0.013s)
1 test passed (1 total in 1 test suite, run time 0.371s)

should there be a more friendly error that fails before it goes to watchman?

@cpojer
Copy link
Member

cpojer commented Mar 15, 2016

I think the description inside of Jest makes sense but it might make sense to add this to the top of https://facebook.github.io/watchman/docs/troubleshooting.html @wez what do you think?

@wez
Copy link

wez commented Mar 15, 2016

facebook/watchman#25 is the underlying issue; we use the .git dir for synchronization cookies, but can't tell if you remove it at runtime, and that breaks queries against that watch. If this is deemed a common enough issue to add special troubleshooting information, I'd rather we just fixed the underlying problem.

This is totally out of scope for jest to deal with, FWIW, and I think the messaging currently shown by jest is reasonable; it shows the error returned by watchman (so it isn't opaque) and suggests places to go look for help.

@wez
Copy link

wez commented Mar 15, 2016

For more color, if you don't have a .git dir when you initiate the watch, you won't have this problem. The issue is the transition from it being there to being deleted. If you create and delete it after the watch was started, watchman won't care because it will be using the watch root for synchronization cookies.

@cpojer cpojer closed this as completed Mar 15, 2016
@aaronabramov
Copy link
Contributor Author

i got another one, probably related to watchman, but i'm not sure

screen shot 2016-04-21 at 4 18 02 pm

goes away with git init . again, but doesn't have a friendly error message

@cpojer
Copy link
Member

cpojer commented Apr 22, 2016

We now have more control over fixing this. We should just not use watchman if it throws. Here is what we could do:

See https://github.com/facebook/jest/blob/052af961fb469f78ddcbd623b39622416fc21da9/packages/jest-haste-map/src/index.js#L329

  • catch errors thrown by crawl (not sure if this is thrown before we create the promise or in the promise chain. Seems like it is before that?)
  • if (crawl === watchmanCrawl) { console.warn the watchman error and retry with node crawl } – this could highlight that watchman should be initialized and link to the watchman troubleshooting page which the thrown error should do from the watchman crawler.
  • If that fails too, re throw.

@cpojer cpojer reopened this Apr 22, 2016
@cpojer cpojer closed this as completed Apr 28, 2016
ghost pushed a commit that referenced this issue Apr 28, 2016
Summary:
Fixes #802.
Closes #953

Reviewed By: kentaromiura

Differential Revision: D3234755

fb-gh-sync-id: 2289b8a351c743b84f1f31593e48d74c3395cffe
fbshipit-source-id: 2289b8a351c743b84f1f31593e48d74c3395cffe
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants