-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Overkill Restarting On File Opening #1208
Comments
Running with verbose mode on, the trigger is seen as:
Just clicking on the 1000.json file to open it in VSCode editor causes the trigger and restart. |
What, in Windows, are you using to run nodemon? Is it the command prompt, powershell, git bash, or something else? Also, I suspect this is because somehow the OS is triggering a notify of file change - rather than nodemon doing anything special… |
I am using Powershell. |
@atom0s are you able to replicate in a non-powershell? (just to rule out vs code or something more general) |
Yes, it happens with a normal command prompt as well. Just tested. It does seem to be random when it will happen. Trying to trigger it constantly does not work and replicating it takes a few launches to get it to happen each time. |
Can you re-test with [email protected]? There's been a few changes that might affect your testing (I couldn't replicate with powershell on my own windows machine). |
I'm having a similar issue... when using atom if I have multiple files open (not just being previewed) and I switch between them (e.g., switch tabs), the file I switch to is triggering a restart. No saves are taking place and nothing should be modifying those files. Just updated and verified the issue again with [email protected], please let me know if any other info would be helpful! |
@SpencerKaiser can you include a screenshot of the nodemon output with |
@remy Huh... now the behavior is changing up a bit and it's only triggering when I switch to certain files. Here's the output when I switched between several files with
|
Maybe git is modifying files or my editor is modifying them for me on git's behalf because it seems like the restart only triggers for files with unstaged changes |
Sorry for the delayed response, been busy with holidays and family etc. It is hard to reproduce this consistently, it seems to happen at random for me as well similar to what Spencer mentioned in his above response. Sometimes a file will trigger, sometimes it won't. I have to restart VSCode to get it to start happening again sometimes. So it seems very random and inconsistent. One thing I will say is that for me, Git is not related as it was happening on a folder/project that was not in any type of repository and was just local to the system. Here is an example with latest nodemon. In a semi-large project with a lot of packages installed. Opening the yarn.lock file for "preview" mode in VSCode (ie. click it once it opens a preview/temp window vs. a full editor until you either double click the file or start typing in the editor.) This triggers nodemons change check. procmon shows this for the node process running nodemon: https://i.imgur.com/14q6a1T.png It hits the main specific file (in this case yarn.lock) first, then loops the entire project afterward in the same manner. |
@atom0s I'm not familiar with procmon, so I'm not sure why (or what) is walking through your current working path, but can you include the output of Like I said, I can't replicate at the moment, so I'm unsure of where the root of the issue is. |
When express requests the file to render view, it detects as a change and reloads
|
@alexisdiel I'm guessing you have a nodemon config in place, only because you're currently watching everything with **. |
Sure @remy |
@atom0s still waiting on a reply. Any chance you're able to follow up? Or I can close and re-open if others are seeing this issue (in a way that it's replicable). |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
Same as @alexisdiel - express opens a |
Not sure what the issue is, but reinstalling fixed for me. npm uninstall -g nodemon
npm install -g nodemon |
For me, it used to happen on the node app itself opening files using It may be related to HBS, since we started relying on it heavily when this first started to happen. However, uninstalled & reinstalled nodemon to version 1.17.5, no restarts yet. Will comment here again if the issue is back again. Edit: Nope, the issue still exists. |
I am also affected by this issue, but only since the 1803 Window Update in April. Node; v8.11.1 Something is triggering a restart when opening a file, but not consistently. Restarts are also triggered almost at random for no obvious reason. I checked the timestamps on the files on the project -- they are not updating. Actually, I don't think this is a problem with nodemon specifically. I'm adding my comment here because this thread is the closest thing I have found to anyone else suffering from this problem! I also have a React project that uses webpack which also suffers from similar annoying restarts. |
This is with no editors open, just running gulp-nodemon, and with
Some interestng points:
So my general feeling is that |
Yes! |
Thanks for the confirmation @svogal. With that in mind I've checked this out looking at fixing it. Check out |
Your solution seemed to work for me. I was running a node app with express using Pug (Jade) and the pug files were triggering the changes) |
@remy this isn't stale, the issue (to sum up the discussion above) is fixed in paulmillr/chokidar#762 and once chokidar do a release, and nodemon uses it, the problem will go away. |
I've raised a separate issue since thus one is closed - all |
Fixes #1522 Fixes #1208 Thanks to @mikemaccana for original PR
nodemon -v
: 1.14.7node -v
: 8.9.4nodemon
Expected behaviour
Restarts triggered when a source file is altered.
Actual behaviour
Restarts are triggering just opening the files in an editor such as VSCode.
Steps to reproduce
Soon as the file is opened, Nodemon will trigger a restart/refresh.
Seems a bit overkill to be triggering just when the file is opened in an editor such as VSCode. If I run with legacy mode (-L) this stops happening but then I have the issue of every file being polled excessively as the docs state.
Everything is working as it should otherwise, but the retriggering while using VSCode seems a bit excessive. I can't find any way to turn this off either or prevent it from happening so that it goes back to only updating when a file is saved.
The text was updated successfully, but these errors were encountered: