-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
File change watcher is not working in TextMate2 on Mac #1053
Comments
I would be very surprised if this was true - as the core Hugo devs are mostly hugging their pretty Macs. I'm Linux. Can you confirm this @mdhender ? |
I'm not having any issues with the current master recognizing multiple changes:
|
The Mac issue was observed in the computer of @reginaldosousa. Maybe he can give more detail about his Mac. We tested many times, and got the same behavior even after resetting the entire GOPATH (bin, pkg and src). |
It looks like there is an outdated dependency for the v0.13 tag.
|
FWIW:
|
There are (big) rooms for improvements in the Go packaging world. So, if you build v0.13 now (if it had built successful), you will not get the same binary now compared to when it was released (because third partiy deps have changed). So I would either:
|
@bep If you start over with a clean GOPATH, are you able to successfully build v0.13?
We should not create other ways to build/install things that are made in Go. The go tooling is sufficient enough for building and installing things. IMHO it is nice to have a Brew formula to install a binary or maybe install Go and use it to build Hugo, but applying a patch just because the v0.13 release got wrong, is a smell for me. In this case, I suggest creating a v0.13.1 release with the proper fix. |
|
For "bulding from a release tag" to be a success, we need to have a source release process that also includes thirdparty deps. I see discussion about a formal improvements of the current situation at go-nuts/go-dev mailing list, but it's not an easy task and not something that can be solved by Hugo alone. @spf13 is the man to talk to about releases. |
I know that "v014-DEV build works on my Mac" isn't the answer that you're looking for, but it does. The only time I've had problems with the watch stopping were when there were errors in the templates. Sometimes the errors cause me to have to restart the server. |
Our templates does not have errors, nor warnings. At least Hugo is not complaining. If is there some way to debug this, maybe we (me and @reginaldosousa) could help fix the issue, but we need help to debug it. |
Can you share the template? I have time this afternoon to run on my Mac to see if I can duplicate the issue. That would be a first step. |
It is based on the original Hugo docs template, extracted from it's own source repository. |
Installed via homebrew
and have the same problem. I am running Especially when changing and saving the same file twice. |
I can't replicate that on 10.10.3, with Hugo 0.14 also installed via |
Odd. I am also on 10.10.3. |
If you run it with |
|
@bep yupp! |
The good thing is, I do not give up easily. I have found a pattern (weird one, but still, a pattern).
I I instead make the changes by just appending to the file:
I can make many changes and everything works as expected. So it must be something fishy with the events triggered by the repetitive saves in Textmate2. @tcurdt what text editor do you use? |
It's also working normally in TextEdit. So TextMate2 is the problem for me. |
I can replicate this on TextMate also. It does not happen when I'm using Emacs. |
@bep Wow - that I didn't expect. Was also using Textmate2 at the time. |
Yea, looks like it's the Atomic Save feature that messes up live reload stuff (not only for Hugo, but also Grunt etc.) -- I can not find a way to turn it off (it was an option in TextMate 1). |
Maybe worth filing a bug on the watcher package then. |
I've now seen this in a js setup as well - which to me suggests a problem on an even lower level. Super annoying. |
Hello everyone. I installed Hugo with homebrew and I am also getting the problem where the server with the --watch option tracks only one save with Textmate 2.0-beta.7.4. I'm on a MacBook Air and OS X Yosemite 10.10.4. I could use another text editor, but for me Textmate is very comfortable. Has anyone figured out a straight forward workaround? Thanks to all of you. Wonderful work! |
I just ran into this as well. Here's some issues from the fsnotify project that are probably related: I'm not a Go developer, so I don't know that I can be much help, but here's some links I found in researching this that may be helpful to the Hugo developers: |
Hm, I've done some testing with https://github.com/emcrisostomo/fswatch, with https://github.com/shama/gaze (the library behind gulp, grunt, etc), and with https://github.com/paulmillr/chokidar (the library behind browserify, webpack, etc) and all of them seem be succeeding at capturing multiple consecutive Textmate 2 saves. So I'm going to try and wire together a workaround to hugo server -w using one of these aforementioned projects until the underlying issue gets solved in hugo. Maybe hugo could suggest a workaround like one of these in the docs, until a hugo fix surfaces... |
We will when a workaround arrives. |
Thanks Kevin. |
I thought you'd like to know that this issue affects me when I use Brackets. It might detect the first change after a restart but doesn't after that. However, switching to TextSoap watch works fine. HTH |
I get no updates at all with Atom 1.3.2/1.33. With TextEdit updates happen as I type, with Coda updates happen on file saves. Hugo v0.15 via brew. |
I have done some tests with
This hack-of-the-year works in my simple tests: if event.Op&fsnotify.Remove == fsnotify.Remove {
err = watcher.Add(event.Name)
if err != nil {
log.Fatal(err)
}
} @nathany - any input/advice on a temporary workaround for Hugo? This bug bugs me ... /cc @spf13 @anthonyfok |
I have done some more testing and created a workaround-PR, see #1766 |
An edit in `TextMate` on OS X triggers the events `CHMOD` and `REMOVE`. This makes `fsnotify` stop watching that file. This commit works around that problem by re-adding the file to the watcher on `REMOVE` if the file still exists. See gohugoio#1053
@jbshirk just tested Brackets (nice editor) on OS X -- and it works fine for me re. watching (even without my patch). |
This patch in |
Thanks @bep. https://github.com/go-fsnotify/fsnotify/pull/111 is merged. Those waiting for this fix can update fsnotify and rebuild Hugo.
|
@bep Yes, it turned out to be a complex of issues, not the least was google drive interfering with normal finder functioning. Now brackets seems to be working the best of all the others I've tried. |
It seems that this is still an issue w/version 2.0-rc.4. |
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. |
File watching in the current master version is broken in Mac, but not on Linux. Hugo looks to detect only the first change. Another sub-sequential changes are not detected.
I also had to checkout the
967d001ebe40cfe90992d953880356a495216202
version instead of the v0.13 tag because the v0.13 cannot be built.The text was updated successfully, but these errors were encountered: