`hugo mod get -u` seems does not update anything and modules get removed when `hugo mod tidy`

Hi there,

I have issue when update the modules, when I’m execute hugo mod get -u command it doesn’t display anything and the modules are not updated at all.

But, when I’m using hugo mod get -u github.com/FarrelF/stack-modified command, the module successfully updated.

And, when I’m execute hugo mod tidy command for tidying modules (especially go.sum file) from GitHub Codespaces that I just created after I update it, the github.com/FarrelF/stack-modified module get removed from go.mod and go.sum file, that’s quite strange for me, as I included this module to my module configuration.

But, the hugo mod tidy doesn’t display and do anything in my computer, even if I append --logLevel argument.

So, this is what I’m doing on my computer:

  1. Execute hugo mod get -u to update all modules as usual (Doesn’t display and do anything)
  2. Execute hugo mod get -u --logLevel (insert any level) (Only display error from go itself)
  3. Execute hugo mod get -u github.com/FarrelF/stack-modified to update specified module (Success)
  4. Execute hugo mod tidy to tidy modules (Doesn’t display and do anything)
  5. Execute hugo mod tidy --logLevel (insert any level) (Same as point 4 and doesn’t display anything with logLevel)

And, the following is from my GitHub Codespaces:

  1. Execute hugo mod get -u to update all modules as usual (Doesn’t display and do anything)
  2. Execute hugo mod get -u --logLevel (insert any level) (Only display error from go itself)
  3. Execute hugo mod get -u github.com/FarrelF/stack-modified to update specified module (Success)
  4. Execute hugo mod tidy to tidy modules (Removes github.com/FarrelF/stack-modified module from go.mod and go.sum)
  5. Execute hugo mod tidy --logLevel (insert any level) (Same as point 4 and doesn’t display anything)

There is my public repository:

The following is my hugo env:

hugo v0.114.1-e9b716ad9869b79e7c374bbdae4daf5ee6406bd4+extended windows/amd64 BuildDate=2023-06-23T11:02:58Z VendorInfo=gohugoio
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.20.1"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"
github.com/sass/dart-sass/protocol="2.1.0"
github.com/sass/dart-sass/compiler="1.63.6"
github.com/sass/dart-sass/implementation="1.63.6"

And, my go version is:

go version go1.20.5 windows/amd64

I don’t know why I got different Go version from hugo env and go version command, even if I create new Codespaces from GitHub, I still get different Go version when I get latest version of Go from go version command. Is Go binary bundled in Hugo?

Is this bug? Or, is there something wrong with my configuration? I don’t change anything in my configuration file (except for re-enabling Arc that not much change), themes and I just add the heart handshake icon to my modified theme, so I can’t figured out of this issue.

Is this issue are related to `hugo mod get -u ./...` seems does not update all modules to latest version? I think it related to that issue, but perhaps there is another solution that I can do for this kind of problem.

Thank you for your help before :slight_smile:

Let’s figure out the Go version mismatch first.

From the Windows command prompt (CMD), type:

where.exe go

The output from where.exe go command is:

C:\ProgramData\scoop\shims\go.exe

And, the output from C:\ProgramData\scoop\shims\go.exe version command is:

go version go1.20.5 windows/amd64

Did you install Hugo as a scoop package?

Yes, I install Hugo as a scoop package.

So…

go env   # displays which version of Go is installed
hugo env # displays which version of Go was used to compile Hugo
1 Like

And…

hugo mod get -u ./...

When I’m executing hugo mod get -u ./... command on my GitHub Codespaces that I just created it again, this is the output:

Update module in /workspaces/Blog
hugo: downloading modules …
hugo: collected modules in 2874 ms
go: downloading github.com/CaiJimmy/hugo-theme-stack v2.6.0+incompatible

And, it doesn’t update the modules nor change anything.

But, when I’m execute it on my computer, it only displays:

Update module in C:\Users\Farrel Franqois\Git Files\FarrelF\Blog

And, still same as in Codespaces, it does not update all modules.

I’m guessing here, but have you tried clearing your mod cache?

hugo mod clean --all

Yes, I was tried that command before, it cleaned all modules cache. But, when I’m update it with hugo mod get -u ./... command it doesn’t update anything and this is the output:

Update module in C:\Users\Farrel Franqois\Git Files\FarrelF\Blog
go: downloading github.com/CaiJimmy/hugo-theme-stack/v3 v3.16.0
go: downloading github.com/CaiJimmy/hugo-theme-stack v2.6.0+incompatible

And, this is result when using Codespace:

Update module in /workspaces/Blog
hugo: downloading modules …
hugo: collected modules in 2061 ms
go: downloading github.com/CaiJimmy/hugo-theme-stack v2.6.0+incompatible

It doesn’t change anything too.

Module updates are working for me as expected, regardless of whether or not it has a tagged release.

I did see this:
https://github.com/FarrelF/Blog/blob/main/config/development/module.toml

1 Like

Ah, sorry my bad. I just comment out that module replacements and it solves almost all of my problem regarding Hugo Modules, as the hugo mod tidy is still not yet change anything on my computer.

I use it before so I can test my modified theme before I push it to GitHub on development environment and I can still update modules back then, but now it’s just a problem.

Sorry I’ve inconvenienced you before and thank you for your help :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.