I’m not able to reproduce the issue with your Portfolio site. Based upon your earlier description, it sounds like it only happens when running VSC. Is that correct? If so, what VSC extensions are you using?
I do get the same unnecessary rebuilds on Windows. I have not investigated this further. I am using Emacs which runs inside WSL2. If I get these multiple rebuilds it is always the same file type. Usually a couple SVGs oder JSON-files. So I guess some program or routine is touching or indexing them. Not sure if this info is of interest here.
As I said, it doesn’t necessarily occur when I open individual files in VSC. It happens when I’ve the folder opened and then open one of the files from my website.
Ok, I did a file audit (Windows). What I found was that these changes come from Hugo, not another program. They are triggered by a normal server update and happen exactly one second later:
This is the Handle Manipulation, which comes from an attempt to duplicate a handle to an object. This belongs to the first saving.
Protokollname: Security
Quelle: Microsoft-Windows-Security-Auditing
Datum: 16/10/2020 11:28:09
Ereignis-ID: 4690
Aufgabenkategorie:Handle Manipulation
Ebene: Informationen
Schlüsselwörter:Überwachung erfolgreich
Benutzer: Nicht zutreffend
Computer: PC
Beschreibung:
Es wurde versucht, ein Handle zu einem Objekt zu duplizieren.
Quellhandleinformationen:
Quellhandle-ID: 0xb9c
Quellprozess-ID: 0xb98
Neue Handleinformationen:
Zielhandle-ID: 0x6114
Zielprozess-ID: 0x4
Source Process ID 0xb98 is PID 2968 and this was Hugo Target Process ID 0x4 is PID 4 and this is System
After this, each file gets four Event IDs, 4658, 4656, 4663, and 4658 from Task Category File System.
1 second later, the procedure is repeated.
To sum up, I have no idea whats going on, but the files are not really changed though a change is detected. I assume it relates to this Handle Manipulation. Maybe it has something todo with caching.
Well, to add to the above reply, when I monitored file access in my post, I also got some hugo.exe entries in the list of programs that wrote to my files. But, I ignored (and later filtered the it from the list) thinking that’s how Hugo works maybe.
I seem to be having the same issue as HenrySkup. Hugo seems to be rebuilding constantly. I can’t seem to figure out what is causing it. I did not encounter this issue with Hugo previously. I’m curious why this has started to happen with recent versions. I may to revert back to an early version.
Remedies Attempted
I’ve tried running hugo server inside of the VS Code terminal, Terminal and iTerm2. The issue persists for all terminals. I’ve also tried disabling all extensions inside of VS Code.
Tech Stack
OS: macOS Catalina (10.15.6)
Browser: Firefox (81.0.2)
Editor: VS Code (1.50.1)
Hugo version: v0.76.5
I am pretty sure that the linked post will have updates if updates are found to this issue. Please add your findings to that post to keep people already involved updated. New posts will not send them notifications.
I also suggest that you either share the actual project or if that’s not possible then share a minimal repo that reproduces the problem on MacOS, for people to see what’s going on.
I’m joining this discussion a little late, but I am getting these rebuild loops too, using Hugo version 0.101.0 in a Docker image klakegg/hugo:0.101.0.
Was there ever a resolution to these issues?
EDIT 1:
To clarify, I am developing in VS Code, but am running Hugo from an independent Terminal window. I have tried closing VS Code before starting the docker image but the looping persists.