Hugo+PaperMod fails on GitHub Actions: can't evaluate field LanguageCode in type *langs.Language

I have a website which is hosted on GitHub; I use hugo v0.83.0 and the PaperMod theme. Everything used to work without any issues until recently, but today I pushed some minor changes and got the following error message from GitHub actions:

  hugo \
    --gc --verbose \
    --baseURL https://am-press.github.io/
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    HUGO_VERSION: 0.83.0
    GITHUB_PAGES: true
INFO 2024/02/27 20:21:40 Using config file: 
Start building sites … 
INFO 2024/02/27 20:21:40 syncing static files to /home/runner/work/am-press.github.io/am-press.github.io/public/
ERROR 2024/02/27 20:21:40 render of "section" failed: "/home/runner/work/am-press.github.io/am-press.github.io/themes/hugo-PaperMod/layouts/_default/rss.xml:59:17": execute of template failed: template: _default/rss.xml:59:17: executing "_default/rss.xml" at <site>: can't evaluate field LanguageCode in type *langs.Language
ERROR 2024/02/27 20:21:40 render of "home" failed: "/home/runner/work/am-press.github.io/am-press.github.io/themes/hugo-PaperMod/layouts/_default/rss.xml:59:17": execute of template failed: template: _default/rss.xml:59:17: executing "_default/rss.xml" at <site>: can't evaluate field LanguageCode in type *langs.Language
Error: Error building site: failed to render pages: render of "section" failed: "/home/runner/work/am-press.github.io/am-press.github.io/themes/hugo-PaperMod/layouts/_default/rss.xml:59:17": execute of template failed: template: _default/rss.xml:59:17: executing "_default/rss.xml" at <site>: can't evaluate field LanguageCode in type *langs.Language
ERROR 2024/02/27 20:21:40 render of "section" failed: "/home/runner/work/am-press.github.io/am-press.github.io/themes/hugo-PaperMod/layouts/_default/rss.xml:59:17": execute of template failed: template: _default/rss.xml:59:17: executing "_default/rss.xml" at <site>: can't evaluate field LanguageCode in type *langs.Language
ERROR 2024/02/27 20:21:40 render of "section" failed: "/home/runner/work/am-press.github.io/am-press.github.io/themes/hugo-PaperMod/layouts/_default/rss.xml:59:17": execute of template failed: template: _default/rss.xml:59:17: executing "_default/rss.xml" at <site>: can't evaluate field LanguageCode in type *langs.Language
Total in 191 ms
Error: Process completed with exit code 255.

I have configured GitHub actions using this YAML file, that is,

name: Deploy Hugo PaperMod Demo to Pages

on:
  push:
    paths-ignore:
      - "images/**"
      - "LICENSE"
      - "README.md"
    branches:
      - main
  workflow_dispatch:
    # manual run
    inputs:
      hugoVersion:
        description: "Hugo Version"
        required: false
        default: "0.83.0"

# Allow one concurrent deployment
concurrency:
  group: "pages"
  cancel-in-progress: true

# Default to bash
defaults:
  run:
    shell: bash

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  # Build job
  build:
    runs-on: ubuntu-latest
    env:
      HUGO_VERSION: "0.83.0"
    steps:
      - name: Check version
        if: ${{ github.event.inputs.hugoVersion }}
        run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}"
      - name: Install Hugo CLI
        run: |
          wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \
          && sudo dpkg -i ${{ runner.temp }}/hugo.deb
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: main
      - name: Setup Pages
        id: pages
        uses: actions/configure-pages@v1
      - name: Get Theme
        run: git submodule update --init --recursive
      - name: Update theme to Latest commit
        run: git submodule update --remote --merge
      - name: Build with Hugo
        run: |
          hugo \
            --gc --verbose \
            --baseURL ${{ steps.pages.outputs.base_url }}
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1
        with:
          path: ./public
  # Deployment job
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

I would appreciate any help with this.

You need to upgrade Hugo to a later version.

Thank you very much. This solved the issue. I used version 0.123.4 (I https://github.com/gohugoio/hugo/releases/download/v0.123.4/hugo_0.123.4_linux-amd64.deb)

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