Hi, I have the same issue going on and same setup. Autosave is off in VSC. Could you folks explain what you mean by images causing this? I do have images on the site, but I’m not in the middle of editing them. Crazy reload every two seconds was happening before I had any sort of image processing(resizing) added.
Yeah, it’s getting worse by updates probably. During my 0.74 times, it wasn’t as frequent for me (or maybe, my website was very basic back then). But, with 0.76, it’s more frequent. I have noticed some pattern in my case though. If I leave the server on for long time (the threshold is unknown) and then if I expand my minimised VSC window, I get this change detected for almost all my files in static and assets. These files are photos, videos, fonts, etc., basically, the files that aren’t really changing, but, a lot of changes are triggered.
Here’s my results after about 40 minutes of testing:
As I said in the previous reply of mine, I get this message if I leave the server running for long. So, I started the server in VSC Terminal and kept a file (already saved) open. Then I minimised the VSC window and carried on with my other work (nothing to do with my website folder). All the disk I/O is happening outside that of project folder. I’m uploading files to Drive, creating some vector graphics, etc. Then, I returned to VSC and opened another file from my website in the editor and just as I opened it, I got the first change detected for the newly opened file, followed by:
Now these files weren’t even touched by me. Maybe behind the scenes something is happening, but, I don’t know what. This is my usual and typical day usage of Hugo. I am working on the website, keep the server on and go on to create some graphic or collect some images, etc. for the website content and forget that the server is on. When I return, that’s what happens.
I don’t know if the others are also facing the issue under same circumstances, but, these were my findings about this case.
I don’t have OneDrive installed. The uploading files to Drive part, I meant, I’m manually uploading files from my External Hard Disk to Google Drive using Chrome. My website’s folder exists on the C:\ as you can see in the console log.
This looks like Windows, which I used last time in 2004. There must be tools to “track file access on windows”. Type it into Google and see what comes out. You basically want a list of programs and processes that access C:\\Users\\Hrishikesh\\Desktop\\Portfolio\\content\\projects\\carry-on-bot\\ and C:\\Users\\Hrishikesh\\Desktop\\Portfolio\\content\\projects\\dropbox\\assets\\ (is that a Dropbox dropbox or just a folder named dropbox? If it’s a Dropbox dropbox translate @jmooring’s comment from OneDrive to Dropbox))
Someone is touching your files and you want to find out who (process/program) this is
It’s just a folder named Dropbox. I don’t have any cloud sync services installed on the device.
Alright. I’ll update the thread with my findings in a few hours.
But if that’s the case, it should also rebuild when VSC is minimised. That doesn’t happen (according to the console). It happens only when I reopen the minimised window and open a file in the editor. In any case, I’d still check if any app or something is messing up here.
I would suspect some kind of plugin in the IDE. If it has a debug mode then disable everything and re-run.
Note: Up to now only people with VSCode are reporting that issue in this thread. It’s definitely not coming up in PhpStorm/WebStorm or Sublime Text. Might be worth a ticket over in whatever Code has as support forum.
Makes sense. I’d first check if the files are getting changed or move this topic to VSC forums.
About this, well, I have some websites made in Gatsby. I use VSC for that too. Such kind of triggers don’t occur in it. Yeah, those are different websites, with different files and content structures and frameworks to begin with. But, I ruled out VSC being the cause of this trouble because of the fact that it doesn’t happen in Gatsby. For me, my Gatsby websites reload only when I save a file myself in one of the watched directories. I’ll still go ahead and monitor VSC’s activities too.
I tried that. I closed all apps, left the computer table for about half an hour, just ket Hugo server running through CMD and as soon as I opened VSC and a loaded a file in it from my website folder, the changes got triggered.
However, it didn’t trigger when I opened a single file in VSC. It only got triggered when I opened the entire folder and then loaded a file in it. It’s probably being caused because VSC is then checking the changes with my Git repo. Just a guess. So, probably VSC is accessing and checking the changes of the entire folder and that’s getting detected by fsnotify.
Thanks for that info. I found a kinda similar issue for fsnotify: https://github.com/fsnotify/fsnotify/issues/323. Not saying this should be immediately tried or considered as a bug, at least not till it’s confirmed as the cause of the problem.
I tried Microsoft’s Process Monitor without much luck. It didn’t mention any new process that wrote to any of those files, but, Hugo still detected some changes. However, I was filtering the events that included only ‘Write’ access because there were a lot of events otherwise that were increasing by every few milliseconds. Probably, one of them has an answer, but, it’s too difficult to read the list.
Sadly, even after a lot of trials and errors, the exact cause is still undetermined. If at all someone ends up with more information to narrow this down, that’d be great.