medley icon indicating copy to clipboard operation
medley copied to clipboard

Hugo won't build the site on my Mac

Open hjellinek opened this issue 1 year ago • 8 comments

Describe the bug Hugo produces an error message and exits when I try to process a local fork of interlisp.github.io.

To Reproduce Use brew to install go and hugo. Run hugo server.

Expected behavior Server runs and allows me to browse the generated site.

Screenshots N/A. See transcript below.

Context (please complete the following information):

  • OS: macOS
  • OS Version: 13.6.7 (22G720) - Ventura
  • Host arch: x86_64
  • Hugo version: v0.126.1+extended darwin/amd64

Additional context hugo says Error: error building site: assemble: failed to resolve media type for "mmark" and exits

$ hugo server
WARN  DEPRECATED: Kind "taxonomyterm" used in disableKinds is deprecated, use "taxonomy" instead.
ERROR deprecated: config: languages.en.description: custom params on the language top level was deprecated in Hugo v0.112.0 and will be removed in Hugo 0.127.0. Put the value below [languages.en.params]. See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120
hugo: downloading modules …
hugo: collected modules in 21080 ms
Watching for changes in /Users/hjellinek/Projects/Interlisp.github.io/{archetypes,content,data,layouts,package.json,static}
Watching for config changes in /Users/hjellinek/Projects/Interlisp.github.io/hugo.toml, /Users/hjellinek/Projects/Interlisp.github.io/go.mod
Start building sites … 
hugo v0.126.1+extended darwin/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=brew

Built in 680 ms
Error: error building site: assemble: failed to resolve media type for "mmark"
$ hugo version
hugo v0.126.1+extended darwin/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=brew

hjellinek avatar May 27 '24 20:05 hjellinek

@hjellinek I don't have a Mac handy right now - but, I think you can fix the problem by going to the file, Interlisp.github.io/content/en/project/credits.md and removing line #5, markup: mmark.  The line doesn't add any value, We don't use math markdown on this page.

Give that a try and let me know.  If that doesn't work I'll try and duplicate the problem on a Mac later this week.

stumbo avatar May 27 '24 21:05 stumbo

Thanks, that let me get further. Now it bombs out because _internal/google_analytics_async.html is missing.

$ hugo server
WARN  DEPRECATED: Kind "taxonomyterm" used in disableKinds is deprecated, use "taxonomy" instead.
ERROR deprecated: config: languages.en.description: custom params on the language top level was deprecated in Hugo v0.112.0 and will be removed in Hugo 0.127.0. Put the value below [languages.en.params]. See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120
Watching for changes in /Users/hjellinek/Projects/Interlisp.github.io/{archetypes,content,data,layouts,package.json,static}
Watching for config changes in /Users/hjellinek/Projects/Interlisp.github.io/hugo.toml, /Users/hjellinek/Projects/Interlisp.github.io/go.mod
Start building sites … 
hugo v0.126.1+extended darwin/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=brew

ERROR render of "section" failed: "/Users/hjellinek/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/docs/baseof.html:4:7": execute of template failed: template: docs/list.html:4:7: executing "docs/list.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:52:16: no such template "_internal/google_analytics_async.html"
ERROR render of "home" failed: "/Users/hjellinek/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/_default/baseof.html:4:7": execute of template failed: template: home.html:4:7: executing "home.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:52:16: no such template "_internal/google_analytics_async.html"
Built in 723 ms
Error: error building site: render: failed to render pages: render of "404" failed: "/Users/hjellinek/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/[email protected]/layouts/_default/baseof.html:4:7": execute of template failed: template: 404.html:4:7: executing "404.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:52:16: no such template "_internal/google_analytics_async.html"

hjellinek avatar May 27 '24 22:05 hjellinek

@hjellinek I was able to reproduce the problem on a my Mac.  It looks like the root cause is brew is pulling a newer version of Hugo, v0.126.1, then is used in production, v0.122.0, or with my local  Linux build, v0.123.7,

I need to spend some time getting a consistent version across a couple machines to determine if it's the Mac build or a breaking update in a Hugo release.

stumbo avatar May 29 '24 01:05 stumbo

Hi @stumbo, I figured I'd save you some effort and install hugo v0.123.7 like so:

$ brew remove hugo
$ brew install [email protected]

But homebrew's hugo isn't susceptible to such incantations. It turns out it's difficult to install an older version of hugo using homebrew. So I'll let you investigate.

hjellinek avatar May 29 '24 02:05 hjellinek

@hjellinek - https://nelson.cloud/how-to-install-older-versions-of-homebrew-packages/ ? Or was it just a hugo specific issue that made it not installable using the @version syntax.

nbriggs avatar May 29 '24 06:05 nbriggs

I used the very technique described in that blog post with Hugo. The error messages mostly came from brew, complaining about nonexistent directories, write-protected directories, etc. I tried to fix the things it complained about, but the Hugo brew install kept overwriting my fixes/workarounds.

hjellinek avatar May 29 '24 16:05 hjellinek

@hjellinek I believe the changes in the branch docsyUpdate will fix your Mac build problems. If you switch to that branch and run: hugo server --renderToMemory you should have a functioning system. If that works, you can layer your updates on top of that to test them.

If you don't use the renderToMemory option you will likely get some permission errors -- Hugo will want to update Read Only versions of a couple files.

There are a couple additional things I need to do before I merge the docsyUpdate branch, but for your testing it should be sufficient.

stumbo avatar May 30 '24 13:05 stumbo

@stumbo Thanks, that got things working once I built the bibliography.

hjellinek avatar May 30 '24 16:05 hjellinek