Cannot bundle SCSS-files

I have a very strange bug which strips out my SCSS from the asset-bundle. Consider the following code:

    {{ $lib := resources.Get "lib.css" }}
    {{ $style := resources.Get "style.scss" | toCSS }}
    {{ $css := slice $lib $style | resources.Concat "bundle.css" }}
    {{ $secureCSS := $css | minify | resources.Fingerprint "sha512" }}
    <link rel="stylesheet" type="text/css" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" />

Hugo shows no error but the bundle.css-file contains only the code from lib.css.

If I change the code to

    {{ $lib := resources.Get "lib.css" }}
    {{ $style := resources.Get "style.scss" | toCSS }}
    {{ $css := slice $lib $style | resources.Concat "bundle.css" }}
    {{ $secureCSS := $style | minify | resources.Fingerprint "sha512" }}
    <link rel="stylesheet" type="text/css" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" />

the output contains the css-version of style.scss (but not lib.css, obviously).

Is this a bug in hugo or can anybody help me find my mistake?

See if doing it in one line makes any difference

{{ $secureCSS := slice $lib $style | resources.Concat "bundle.css" | minify | fingerprint "sha512" }}

Doing it in one line doesn’t change anything – it still doesn’t include the css-version of the SCSS-file.

Gotcha. Can you share your code so that we can attempt to replicate this?

I doubt it it is a bug … What do you get from $style directly?

$style directly works perfect – but of course then the content of lib.css is not included as I don’t include the (broken!) bundle in this case but only the toCSS-version of style.scss.