SASS map.merge() not working in hugo pipe

hello. I am trying to make a very awesome hugo pipe thing, using sass. However, I am currently stuck because i get errors when i use map.merge() function in the scss files. From this page (official sass documentation): https://sass-lang.com/documentation/values/maps

i copied the last example

@use "sass:map";

$prefixes-by-browser: ("firefox": moz, "safari": webkit, "ie": ms);

@mixin add-browser-prefix($browser, $prefix) {
  $prefixes-by-browser: map.merge($prefixes-by-browser, ($browser: $prefix));
}

@include add-browser-prefix("opera", o);
@debug $prefixes-by-browser;
// ("firefox": moz, "safari": webkit, "ie": ms, "opera": o)

and saved it to assets/sass/test.scss .

but i get errors when trying to process a template with:
{{ $testcss := resources.Get "sass/test.scss" | toCSS }}

error:

$ hugo server
Building sites … ERROR 2019/10/02 08:14:15 Transformation failed: SCSS processing failed: file "stdin", line 6, col 28: Invalid CSS after "...by-browser: map": expected expression (e.g. 1px, bold), was ".merge($prefixes-by" 
Total in 26 ms
Error: Error building site: failed to render pages: render of "page" failed: "/home/bud/git/www/lab/themes/muh/layouts/_default/single.html:16:11": execute of template failed: template: _default/single.html:2:3: executing "_default/single.html" at <partial "test.html" .>: error calling partial: "/home/bud/git/www/lab/themes/muh/layouts/partials/test.html:16:11": execute of template failed: template: partials/test.html:16:11: executing "partials/test.html" at <$testcss.Content>: error calling Content: SCSS processing failed: file "stdin", line 6, col 28: Invalid CSS after "...by-browser: map": expected expression (e.g. 1px, bold), was ".merge($prefixes-by" 

Not sure what is going on.

The SASS/SCSS docs should be a little more clear about this, but you’re using unreleased SASS functionality.

https://sass-lang.com/documentation/at-rules/use

It will come in Dart’s implementation first, later in LibSASS (that Hugo uses).

1 Like

@bep Thanks for clarifying that!