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

[Packager] Watchman fails silently if no root_files are found (ex. .git) #2042

Closed
jaredly opened this issue Jul 18, 2015 · 3 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jaredly
Copy link
Contributor

jaredly commented Jul 18, 2015

I kept getting this error:

 ERROR  Watcher took too long to load
Try running `watchman version` from your terminal
https://facebook.github.io/watchman/docs/troubleshooting.html
Error: Watcher took too long to load
Try running `watchman version` from your terminal
https://facebook.github.io/watchman/docs/troubleshooting.html
    at [object Object]._onTimeout (/Users/jaredly/clone/meditrate/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js:98:16)
    at Timer.listOnTimeout (timers.js:110:15)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.

And reinstalled watchman a bunch of times, restarted my mac, etc...

Digging into the sane package, and adding this patch, I was able to discover that the actual watchman error (it was working just fine) was:

resolve_projpath: none of the files listed in global config root_files are present in path `{the project root}` or any of its parent directories

Which really meant: running git init solved everything. But I wasted a lot of time wondering why things were broken.

So I think the right thing to do here is turn off enforce_root_files.

@jaredly jaredly changed the title Watchman fails silently if no root_files are found (ex. .git) [packager] Watchman fails silently if no root_files are found (ex. .git) Jul 18, 2015
@brentvatne brentvatne changed the title [packager] Watchman fails silently if no root_files are found (ex. .git) [Packager] Watchman fails silently if no root_files are found (ex. .git) Jul 20, 2015
@wez
Copy link

wez commented Jul 23, 2015

@jaredly FWIW, at FB, we require enforce_root_files to be set to avoid having folks unwittingly create overlapping watches. Because our source trees are so large this is a very real cause of performance and reliability issues with watching the filesystem, and is in fact the reason why this feature even exists :-)

@amasad is this a side effect of using watch-project exclusively now in sane? Do we know if the only people that are hitting this are at FB? I don't believe that folks outside FB will have the root files restrictions enabled, and certainly not by default. It would be great to double check what is happening there as watch-project is supposed to fall back to watching the directory of interest if we can't locate a root.

@jaredly
Copy link
Contributor Author

jaredly commented Jul 23, 2015

Ok -- yeah I guess it's just because of the watchman config in /etc/watchman.json.
This is an error that we should be able to detect though (as soon as sane exposes error events), and report.

@linshu123
Copy link

I just spent half an hour on this problem. It should really be documented in the troubleshooting page.

frantic added a commit to frantic/react-native that referenced this issue Aug 7, 2015
This file tells watchman to watch this folder if "root_restrict_files"
is turned on.

Fixes facebook#2042
rozele referenced this issue in microsoft/react-native-windows May 25, 2016
Summary:
This file tells watchman to watch this folder if "root_restrict_files"
is turned on.

Fixes #2042
Closes facebook/react-native#2263
Github Author: Alex Kotliarskyi <alex.frantic@gmail.com>
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants