Hi all (developers). I ran into some hassles with the new release: It doesn’t like my setup anymore…
Error: Error building site: "/home/patrick/github.com/dnb-org/dnb-hugo-auditor/content/index/by/last-changed.md:1:1": timed out initializing value. You may have a circular loop in a shortcode, or your site may have resources that take longer to build than the `timeout` limit in your Hugo config file.
My setup is too big, I know. I have plenty of modules with local replacement rules (the repo in the link is using the published tags). Then I do all the CLI parameters to show template metrics and move the localhost to an IP/Port setup so I can test on other devices on my network.
Updating from 0.92.2 to 0.93.0 leads to 100% of these errors above. Before that error came up maybe once in a while (as in once a week or less). It also does not come up at the same file, line, character location and also not from the same module. Just like you would expect in a timeout. I have no timeout though in my config.
Running just hugo server
without any module replacement leads to site execution in max 30 seconds. Removing all local module replacements is helping. The site is running. Now enabling each module replacement one by one will lead to the culprit(s).
From a developer’s point of view (coming from PHP, sorry) though this is not really what I would expect. Is there any way to debug in a more automatic verbose way what Hugo exactly was doing when it failed? I have no problem digging through the dirt to end up at SOMETHING usable. The way Hugo works now (and I know I complained about this about every 6 months now) is not really helpful and I am pretty sure that is because of how Golang and the parallel execution thingy works.
I know the whole “one feature per module” approach I have might be what’s killing me here, but I am a believer in easily reproducible features. Like a menu at a restaurant Let’s add some header tags, some sitemaps and deploy at netlify (= 3 modules).
So basically, what I am trying to find out is what others (you) do to make their modules or even “just” themes easily “debuggable”.
My approach, should nothing better turn up, will be to implement a paranoic debugging feature that uses error reporting levels where the most verbose is “going into this file, doing that range, done with that range, doing this if-else statement”. But honestly… that will feel very very weird and will clutter up the templates.
In a perfect world hugo server --debug
would suddenly start putting a lot of traceroutes for all the template tags it’s encounters into the logfile.
How do you do it? (No answer is wrong if it helps, hehe)
PS: Extra points if you can somehow find a better explanation on why Hugo would throw an “ehm, it’s maybe probably a timeout” error and what would be the errors that might not be timeout related at this point.
PPS: I seriously started to watch a Go Beginners course and Go for Programmers course I got myself a while back at stackskills.com, but I guess it will take a while until I have some level of useful understanding of the intestines of Hugo. And graphs via markdown are just to enticing…