HUGO_VERSION ignored no matter what I set

I’ve set HUGO_VERSION in both production and preview sets of environment variable to various versions like 0.80.0, 0.92.1, etc., but no matter what I set, Pages still uses 0.54 and ends up failing to compile my theme.

The log is as below

23:43:00.711 Initializing build environment. This may take up to a few minutes to complete
23:45:14.935 Success: Finished initializing build environment
23:45:14.935 Cloning repository…
23:45:18.452 Success: Finished cloning repository files
23:45:19.468 Installing dependencies
23:45:19.470 Python version set to 2.7
23:45:20.312 v12.18.0 is already installed.
23:45:20.709 Now using node v12.18.0 (npm v6.14.4)
23:45:20.749 Started restoring cached build plugins
23:45:20.752 Finished restoring cached build plugins
23:45:20.865 Attempting ruby version 2.7.1, read from environment
23:45:21.791 Using ruby version 2.7.1
23:45:22.002 Using PHP version 5.6
23:45:22.031 5.2 is already installed.
23:45:22.037 Using Swift version 5.2
23:45:22.037 Installing Hugo 0.54.0
23:45:22.564 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
23:45:22.565 Started restoring cached go cache
23:45:22.568 Finished restoring cached go cache
23:45:22.593 go version go1.14.4 linux/amd64
23:45:22.597 go version go1.14.4 linux/amd64
23:45:22.598 Installing missing commands
23:45:22.598 Verify run directory
23:45:22.598 Executing user command: hugo
23:45:22.655 Building sites … ERROR 2022/02/20 15:45:22 render of page failed: execute of template failed: template: _default/single.html:3:8: executing _default/single.html at <partial head.html …>: error calling partial: /opt/buildhome/repo/layouts/partials/head.html:24:19: execute of template failed: template: partials/head.html:24:19: executing partials/head.html at : can’t evaluate field Match in type interface {}
23:45:22.655 ERROR 2022/02/20 15:45:22 render of section failed: execute of template failed: template: _default/list.html:3:8: executing _default/list.html at <partial head.html …>: error calling partial: /opt/buildhome/repo/layouts/partials/head.html:24:19: execute of template failed: template: partials/head.html:24:19: executing partials/head.html at : can’t evaluate field Match in type interface {}
23:45:22.655 ERROR 2022/02/20 15:45:22 render of taxonomyTerm failed: execute of template failed: template: _default/list.html:3:8: executing _default/list.html at <partial head.html …>: error calling partial: /opt/buildhome/repo/layouts/partials/head.html:24:19: execute of template failed: template: partials/head.html:24:19: executing partials/head.html at : can’t evaluate field Match in type interface {}
23:45:22.655 ERROR 2022/02/20 15:45:22 render of page failed: execute of template failed: template: _default/single.html:3:8: executing _default/single.html at <partial head.html …>: error calling partial: /opt/buildhome/repo/layouts/partials/head.html:24:19: execute of template failed: template: partials/head.html:24:19: executing partials/head.html at : can’t evaluate field Match in type interface {}
23:45:22.663 Total in 24 ms
23:45:22.663 Error: Error building site: failed to render pages: render of page failed: execute of template failed: template: _default/single.html:3:8: executing _default/single.html at <partial head.html …>: error calling partial: /opt/buildhome/repo/layouts/partials/head.html:24:19: execute of template failed: template: partials/head.html:24:19: executing partials/head.html at : can’t evaluate field Match in type interface {}
23:45:22.666 Failed: build command exited with code: 255

Would you mind providing a screenshot from your dev and prod config?

Env var config:

Cloudflare still installing old Hugo version:

Can you please remove the lowercase env var from both (dev and prod)? Then try again, btw trigger a manual rebuild for your site.


Remove the red ones, keep the green ones.

Thanks


I just got a hint from a colleague. Chances are, that your env vars do include some special chars, or invisible chars.

Please remove ALL env vars and add them by typing them in by hand, don’t copy. Then pls post a screenshot of your env vars again.

If it did not help please also provide your ...pages.dev link.

1 Like

It’s okay now.

Probably should be noted in the documentation that copying (in my case, from the Pages docs) env vars can lead to issues.

Glad to hear!

Will forward this. They are actually already working on making this more clear to the users.

1 Like

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