Greetings all. I keep running into an issue where an error like this is thrown:
Error: add site dependencies: load resources: loading templates: walk: Readdir: decorate: lstat /home/techquila/code/src/github.com/techquila/roadhouse/themes/roadhouse/layouts/partials/techquila@zeta.1652:1567739041: no such file or directory
I find it incredibly unhelpful. It is because an error exists somewhere in one of my template files but no clues given.
If I knew how to reproduce the error I wouldn’t need to ask this question lol.
This was a fresh new site with a new theme I’m developing. It’s not the first time I’ve received this error though as I experienced it in the last site I built as well, which turned out to be caused by an incorrectly stipulated file path, which I assume is the case here too.
Can you offer an explanation of what these numbers represent please? It appears to be some kind of pointer to a file, which i’m obviously missing here.
Ok… the issue was I had an artifact, created from my emacs editor, contained with in the templates directory that was causing this error to throw.
Emacs will create a temporary file to store unsaved changes when a file is opened. I’ll have to adjust my emacs config to tell it where to save these types of files from now on.
My opinion that this is an unhelpful error, and my question remains however: How do I interpret this?
Error: add site dependencies: load resources: loading templates: walk: Readdir: decorate: lstat /some-path/: no such file or directory
It took me some time to find the issue. There was a subdirectory in my static directory, containing a few images, and I had moved those images to another place. All references were adjusted, and I was still getting this error. I could find the reason after a lot of search: There was a simlink for one of those images in my partials directory that was broken after I moved the source file. I rebuilt the symlink and it fixed the issue.
I thought this may give more context and possibly help someone else who may have a similar problem.
That is very much an unexpected error – and there is not way we can provide helpful messages without some AI magic.
What version of Hugo do you run? The output of hugo version?
I remember adding a fix where we skip “file not found errors” in this situation (which can happen if you have a process deleting files while building Hugo or something), and if you’re running a recent Hugo version, it may be something else. Looking at that funky filename, I suggest you start by naming your partials with more sensible names.