Upgrade to Mac M1 broke what worked on linux

My PC which runs ubuntu worked with the hugo_0.13_linux_amd64 and would display the website on my localhost without any problems. When I made a change, it would automatically update the website on my localhost. A few warnings an one error would show on the console, but they wouldn’t prevent it from displaying.

My new computer is a macbook pro with an M1 chip running Ventura. hugo_0.13_linux_amd64 doesn’t work on macbook pro. I installed latest hugo, hugo v0.109.0+extended darwin/arm64

When I run hugo as I would on my ubuntu but on my macbook, tons of warnings and errors will show. It uses a config.yaml. More errors and warning than what was ever seen on my old computer. It will say “Built in 3816ms”, and then immediately exits. Why doesn’t it stay running as it did on my old computer?

I started working through the errors, trying to fix them. However fixing one would cause another to crop up. And now I am stuck as to what the latest batch of errors even mean.

WARNING: calling IsSet with unsupported type “invalid” () will always return false.

WARN 2023/01/10 14:45:45 found no layout file for “HTML” for kind “section”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination

render of “page” failed: “/Users/kwinst/Documents/GitHub/av-doc/site/layouts/overview/single.html:19:41”: execute of template failed: template: overview/single.html:19:41: executing “overview/single.html” at <where .Site.Taxonomies.groups.gettingstarted.Pages “Section” .Section>: error calling where: can’t iterate over

When I check overview/single.html line 19, it shows
{{ $nbGettingStarted := len (where .Site.Taxonomies.groups.gettingstarted.Pages “Section” .Section)}}

The previous line has almost the exact same thing.
{{ $nbWhatsnew := len (where .Site.Taxonomies.groups.whatsnew.Pages “Section” .Section) }}

When I try to figure out what is different, it seems that whatsnew, has a directory called whatsnew under layouts and contains a single.html
I copied that to a gettingstarted directory and edited it changing references from whatsnew to gettingstarted, but it still complains.

I have searched and searched trying to find a definite process to fix this error, but have not found anything. Is there such a thing?

Can someone help me with this please?

There have been many changes (including some breaking changes) since v0.13.0 was released 8 years ago—about 6300 commits to the code base.

To make your site compatible with the current version will take some effort; there isn’t a quick fix.

It would be easier to assist you if you can share the public repository for your site.

Unfortunately I do not have permission to share the repository.

Am I on the right track by creating a gettingstarted directory and changing the references in single.html for whatsnew to gettingstarted?

Otherwise what causes this error?


I cannot answer either of those questions without seeing the source.

Depending on the size and complexity of the site, you might consider starting over from scratch, retaining the content of course.

In case anyone else runs into this problem, I was able to use hugo_0.13 in a docker on my macbook pro M1.
You need at least docker 4.16.1
Next, go to the General section and check the box to enable the Apple Virtualization framework.
Finally, in the Feature in development section, enable Rosetta .

My Dockerfile consisted of

FROM alpine:3.5
COPY . /opt/bin
WORKDIR /opt/bin
CMD ./hugo_0.13_linux_amd64 server --config=/tmp/site/config-local.yaml --source=/tmp/site/ --watch -p 1313

After which I was able to run hugo within the container using the following command.
docker run -it --platform linux/amd64 -p 1313:1313 -v ~/Documents/GitHub/doc/site:/tmp/site --rm hugo

0.13? As @jmooring mentioned this to many people, this version is from year back before M1 was released hence do not expect it to work well on latest equipment.

Install Brew
And from brew install latest Hugo
All work well with M1 and Rosetta is not needed for it as it is native.

Due to lot of changes from 0.13, it’s likely that you will need to adjust your website to work with recent one.