Here is my current hugo version.
hugo v0.109.0-47b12b83e636224e5e601813ff3e6790c191e371 linux/amd64 BuildDate=2022-12-23T10:38:11Z VendorInfo=gohugoio
The following code worked fine until the most recent hugo version. This output comes from the standard version of hugo on my server that rebuilds my sites via cron job.
{{- $styles := slice -}}
{{- $cssOpts := (dict "targetPath" "css/player.css" "outputStyle" "compressed" "enableSourceMap" true ) -}}
{{- $styles = $styles | append (resources.Get "css/player/mediaelementplayer.css") -}}
{{- $styles = $styles | append (resources.Get "css/player/jump-forward.css") -}}
{{- $styles = $styles | append (resources.Get "css/player/skip-back.css") -}}
{{- $styles = $styles | append (resources.Get "css/player/speed.css") -}}
{{- $styles = $styles | append (resources.Get "scss/player.scss" | resources.ExecuteAsTemplate "style.player.css" . | toCSS $cssOpts) -}}
{{ if .Site.IsServer -}}
{{- $style := $styles | resources.Concat "css/empire-player-styles.css" -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" media="screen">
{{- else -}}
{{- $style := $styles | resources.Concat "css/empire-player-styles.css" | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen" />
{{- end -}}
{{- $scripts := slice -}}
{{- $scripts = $scripts | append (resources.Get "js/player/mediaelement-and-player.js") -}}
{{- $scripts = $scripts | append (resources.Get "js/player/jump-forward.js") -}}
{{- $scripts = $scripts | append (resources.Get "js/player/skip-back.js") -}}
{{- $scripts = $scripts | append (resources.Get "js/player/speed.js") -}}
{{- $scripts = $scripts | append (resources.Get "js/player/audio-player.js") -}}
{{ if .Site.IsServer -}}
{{- $js := $scripts | resources.Concat "js/empire-player-script.js" -}}
<script src="{{ $js.RelPermalink }}"></script>
{{- else -}}
{{- $js := $scripts | resources.Concat "js/empire-player-script.js" | minify | fingerprint -}}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
{{- end -}}
It now spits out the following list of errors
hugo v0.109.0-47b12b83e636224e5e601813ff3e6790c191e371 linux/amd64 BuildDate=2022-12-23T10:38:11Z VendorInfo=gohugoio
ERROR 2022/12/25 07:17:05 render of "page" failed: "/home/empire/repo/themes/empire/layouts/episode/single.html:21:3": execute of template failed: template: episode/single.html:21:3: executing "main" at <partial "player-includes" .>: error calling partial: "/home/empire/repo/themes/empire/layouts/partials/player-includes.html:13:37": execute of template failed: template: partials/player-includes.html:13:37: executing "partials/player-includes.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
ERROR 2022/12/25 07:17:05 render of "page" failed: "/home/empire/repo/themes/empire/layouts/episode/single.html:21:3": execute of template failed: template: episode/single.html:21:3: executing "main" at <partial "player-includes" .>: error calling partial: "/home/empire/repo/themes/empire/layouts/partials/player-includes.html:13:37": execute of template failed: template: partials/player-includes.html:13:37: executing "partials/player-includes.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
ERROR 2022/12/25 07:17:05 render of "page" failed: "/home/empire/repo/themes/empire/layouts/episode/single.html:21:3": execute of template failed: template: episode/single.html:21:3: executing "main" at <partial "player-includes" .>: error calling partial: "/home/empire/repo/themes/empire/layouts/partials/player-includes.html:13:37": execute of template failed: template: partials/player-includes.html:13:37: executing "partials/player-includes.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
ERROR 2022/12/25 07:17:05 render of "page" failed: "/home/empire/repo/themes/empire/layouts/episode/single.html:21:3": execute of template failed: template: episode/single.html:21:3: executing "main" at <partial "player-includes" .>: error calling partial: "/home/empire/repo/themes/empire/layouts/partials/player-includes.html:13:37": execute of template failed: template: partials/player-includes.html:13:37: executing "partials/player-includes.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
I am also getting new errors regarding sass compilation.
ERROR 2022/12/25 07:17:05 TOCSS: failed to transform "fork-awesome.css" (text/css). Check your Hugo installation; you need the extended version to build SCSS/SASS with transpiler set to 'libsass'.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
ERROR 2022/12/25 07:17:05 TOCSS: failed to transform "style.empire.css" (text/x-scss). Check your Hugo installation; you need the extended version to build SCSS/SASS with transpiler set to 'libsass'.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
ERROR 2022/12/25 07:17:05 TOCSS: failed to transform "style.empire-dark.css" (text/x-scss). Check your Hugo installation; you need the extended version to build SCSS/SASS with transpiler set to 'libsass'.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
ERROR 2022/12/25 07:17:05 TOCSS: failed to transform "style.player.css" (text/x-scss). Check your Hugo installation; you need the extended version to build SCSS/SASS with transpiler set to 'libsass'.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
Error: Error building site: failed to render pages: render of "page" failed: "/home/empire/repo/themes/empire/layouts/episode/single.html:21:3": execute of template failed: template: episode/single.html:21:3: executing "main" at <partial "player-includes" .>: error calling partial: "/home/empire/repo/themes/empire/layouts/partials/player-includes.html:13:37": execute of template failed: template: partials/player-includes.html:13:37: executing "partials/player-includes.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
Total in 1297 ms
This code has always compiled fine in standard hugo on my server before by including the intermediate scss build resources in the repo from the extended version on my desktop.
Is this a breaking change in hugo by design that I need to account for or are they possibly bugs introduced in the new hugo version?
Any help is appreciated.