Hugo server throw error on Windows

I have a hugo site repo at vlca/mgmamm - Codeberg.org
if I git clone it in Windows and run hugo server, I will get the error

C:\Users\User\Desktop\mgmaSITE\mgmamm>hugo server                                                                       Watching for changes in C:\Users\User\Desktop\mgmaSITE\mgmamm\{archetypes,assets,content,layouts,static}                Watching for config changes in C:\Users\User\Desktop\mgmaSITE\mgmamm\hugo.toml                                          Start building sites …                                                                                                  hugo v0.146.7-1ad3d39dc4693434505fc81f91eed57333017e93 windows/amd64 BuildDate=2025-04-22T17:26:42Z VendorInfo=gohugoio                                                                                                                         ERROR render of "C:/Users/User/Desktop/mgmaSITE/mgmamm/content/en/updates/news/_index.md" failed: "C:\Users\User\Desktop\mgmaSITE\mgmamm\layouts\_default\section.html:6:15": execute of template failed: template: section.html:6:15: executing "main" at <.Content>: error calling Content: "C:\Users\User\Desktop\mgmaSITE\mgmamm\content\en\updates\news\_index.md:10:1": failed to render shortcode "carousel01": failed to process shortcode: "C:\Users\User\Desktop\mgmaSITE\mgmamm\layouts\shortcodes\carousel01.html:11:21": execute of template failed: template: _shortcodes/carousel01.html:11:21: executing "_shortcodes/carousel01.html" at <resources.Get>: error calling Get: CreateFile C:\Users\User\Desktop\mgmaSITE\mgmamm\a: The filename, directory name, or volume label syntax is incorrect.                                                    Built in 4383 ms                                                                                                        Error: error building site: render: failed to render pages: render of "C:/Users/User/Desktop/mgmaSITE/mgmamm/content/en/_index.md" failed: "C:\Users\User\Desktop\mgmaSITE\mgmamm\layouts\_default\index.html:2:38": execute of template failed: template: index.html:2:38: executing "main" at <.Content>: error calling Content: "C:\Users\User\Desktop\mgmaSITE\mgmamm\content\en\_index.md:7:1": failed to render shortcode "video-carousel01": failed to process shortcode: "C:\Users\User\Desktop\mgmaSITE\mgmamm\layouts\shortcodes\video-carousel01.html:9:29": execute of template failed: template: _shortcodes/video-carousel01.html:9:29: executing "_shortcodes/video-carousel01.html" at <resources.Get>: error calling Get: Creat: The filename, directory name, or volume label syntax is incorrect.

According to the first line of error:

 "C:/Users/User/Desktop/mgmaSITE/mgmamm/content/en/updates/news/_index.md" failed: "C:\Users\User\Desktop\mgmaSITE\mgmamm\layouts\_default\section.html:6:15"

my …/news/_index.md is:

+++
date = '2025-04-20T06:00:00+06:30'
draft = false
title = 'News'
[params]
    [params.section]
        carousel = 'include'
+++

{{< carousel01 >}}
images/updates/news/current-issue-20250329-00.jpg:Current Issues Seminar:/updates/news/2025/current-issues-seminar/
images/updates/news/recent-us-tariffs.png:MGMA Statement on Recent US Tariffs:/updates/news/2025/recent-us-tariffs/
images/updates/news/urge-earthquake-csr.jpg:MGMA Urges Members for Contribution to Helping Hands Program to Earthquake Hit Areas:/updates/news/2025/urging-earthquake-csr/
{{< /carousel01 >}}

&nbsp;  
**Update News**

and _default/section.html is:

{{ define "main" }}
    <div class="section-container">
        <div class="section-body">
            {{ partial "breadcrumbs.html" . }}
            {{ partial "languages.html" . }}
            {{ .Content }}
            <div class="page-blocks">
                {{ range sort (sort .Pages.ByLanguage "Date" "desc" ) "Weight" }}
                <div class="page-block">
                        <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
                        {{ .Summary | truncate 180 }}
                        <a href="{{ .RelPermalink }}">READ MORE</a>
                    </div>
                {{ end }}
            </div>
        </div>
        <aside>{{ partial "aside.html" . }}</aside>
    </div>
{{ end }}

according to section.html:6:15, the character at 15th of line 6 is a dot “.” of .Content. so what is happening.
If I git clone it in linux and run hugo server is completely fine.

In case of such errors it usually is good to

  • check hugo version is the same on both systems
    and post the hugo version``
  • not strip the logs when posting
    → there is more after that first line and usually the last error is the most specific

builds fine for me using 0.145.0 and 0.146.7 fails with 0.128.2:

If that is your error, my educated guess you build with different versions:

  • linux > 0.136.3
  • windows < 0.136.0.3

the strings.TrimSpace method has been added in 0.136.3

explanation:

which complains about not being able to

  • render the shortcode faqgroup
  • of page content\en\faq_index.md
  • triggered by rendering the Content of page of a section.
  • because that uses an unknown Method TrimSpace
Error: error building site: render: failed to render pages: 
	render of "section" failed:	"...\mgmamm\layouts\_default\section.html:6:15":
	execute of template failed: template: _default/section.html:6:15:
	executing "main" at <.Content>:
	error calling Content: "...\mgmamm\content\en\faq\_index.md:41:1": 
	failed to render shortcode "faqgroup": failed to process shortcode: 
	"...\mgmamm\layouts\shortcodes\faqgroup.html:3:33":
	execute of template failed: template: shortcodes/faqgroup.html:3:33:
	executing "shortcodes/faqgroup.html" at <strings>:
	can't evaluate field TrimSpace in type interface {}

if that’s not the error - please provide full context. logs, version