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
Retain ref to stop #1
Conversation
You have to retain a reference to the stop function or the watching will be automatically stopped.
Hey @pipobscure, Thanks again for helping fix this issue. Unfortunately, I am still experiencing an issue where folders that are usually watched are no longer watched (the issue disappears when I reboot and comes back for no apparent reason). I have spent considerable time (calculated in days not hours) trying to debug this issue and would love to pick your brain to see if we can figure out what is causing this. Many people (>75K on Stack Overflow alone) are suffering from this issue which makes coding excruciating when using live reload features.
https://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files Do you have any ideas as to what can cause this? The issue is likely not at the fsevents level, but solving this would mean a lot to me and others. Thanks! |
@sunknudsen thanks for letting me know. As soon as I have a minute tonight, I’ll create a test on a hosted OSX machine that watches a folder and then on a timer changes files in it and receives the corresponding fsevents. I’ll then let that run for as long as it takes. I hope this can reproduce the issue and then take a status of what’s happened when it does. So let’s see what that does. The only thing I can think of that would stop listening is when the stop function goes out of scope and is garbage collected. Because the stop function holds the reference to the listener which the. also gets garbage collected. And if that happens then cleanup will stop the listening and free associated memory. But I’ll try to verify this as described above. (Give it a few days though since I expect this to have to run for quite a while before happening in a reproducible manner.) |
@pipobscure thanks so much for helping out. 🤩 I was able to consistently reproduce the issue using my-app/fsevents-issue which essentially is a default create-react-app install with as little code as possible to trigger this issue (see steps). I really don't now how to troubleshoot this issue more with my limited understanding of what's going on under the hood. Let me know if I can help. |
@pipobscure did you manage to find time to run experiments? |
@pipobscure Perhaps this issue got off your radar... I could really use a hand to troubleshoot the above. 🤞 |
You have to retain a reference to the stop function or the watching will be automatically stopped.