Hugo module updates go un-recognised

For a little while now (I can’t pinpoint it to a release, but it worked before) GoHugo seems to be unable to update modules that I updated recently. I have to manually delete the cache in the temporary directory to retrieve the current (latest) version. This leads to updates not arriving on Netlify in the end, where I can’t delete any the temporary cache. (Talking about /temp/hugo_cache).

What I do:

  • module is at v0.0.4 on github (tagged)
  • changes to the module
  • release a new version v0.0.5 to github
  • run hugo mod get -u ./... on a website that uses that module
  • run hugo mod tidy on that website
  • run hugo
  • if the module has some breaking changes (like for instance a new mediatype) that change is not found
  • delete /tmp/hugo_cache
  • run hugo
  • updates are loaded and site is working.

The third last step can’t be done on Netlify so the builds break for a while. I either have to disconnect the repo and re-connect or just wait and try later on.

Something changed, because before the hugo mod get -u ./... immediately updated to new versions of the module.

I CAN manually change the version in go.mod, then run get and tidy again and it will work… but that somehow seems like something Hugo should do by itself.

Long story short: I would expect hugo mod get -u ./... to update immediately to a new release version from Github, but it doesn’t. Is this a bug or does a new feature/procedure require a different approach?

PS: “delete cache and retry deploy” does NOT work on Netlify.

Have you tried using the Go CLI i.e. go get -u ./...

If the problem persists then it’s most likely a Go Modules issue.
If not then it is a Hugo bug and you should file a report on GitHub.

I actually just updated Hugo from 0.88.0 to 0.91.0 on Netlify and it started working. That is strange. I’ll try to recreate the issue.