HUGO

resources.Concat with js - slice interface not supported in concat

I have a partial that looks like this:

{{ $main := resources.Get "js/main.js" }}
{{ $jquery := resources.Get "node_modules/jquery/dist/jquery.min.js" }}
{{ $bridget := resources.Get "node_modules/jquery-bridget/jquery-bridget.js" }}
{{ $flickity := resources.Get "node_modules/flickity/dist/flickity.pkgd.min.js" }}

{{ $js := slice $jquery $bridget $flickity $main | resources.Concat "js/app.js" | minify | fingerprint }}

<script type="text/javascript" src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}"></script>

The error I receive is as follows:

execute of template failed: template: partials/site/scripts.html:6:60: executing “partials/site/scripts.html” at <resources.Con
cat>: error calling Concat: slice []interface {} not supported in concat

Line 6 looks very similar to the example code shown here. What gives?

Update: I believe I solved the above with mounts, but I can’t verify because piping CSS isn’t working either in 0.73.0/extended.

#Mounting Node Modules for Pipes
[module]

  [[module.mounts]]
  source ="node_modules/jquery/dist/jquery.min.js"
  target = "assets/js/vendor/jquery.min.js"

  [[module.mounts]]
  source ="node_modules/jquery-bridget/jquery-bridget.js"
  target = "assets/js/vendor/jquery-bridget.js"

  [[module.mounts]]
  source = "node_modules/flickity/dist/flickity.pkgd.min.js"
  target = "assets/js/vendor/flickity.pkgd.min.js"

Error:

template: partials/site/styles.html:4:46: executing "partials/site/styles.html" at 
 <toCSS>: error calling toCSS: type <nil> not supported in Resource transformations

In styles.html I have

{{ $mycss := resources.Get "sass/main.scss" | toCSS | minify }}
<link rel="stylesheet" href="{{ $mycss.Permalink }}">

And there is definitely an /assets/sass/main.scss file with a series of includes

Update 3: It appears that using mounts causes resources.ToCSS to fail. Once removed, the CSS generated fine. Now I’m back where I started with the original concat error.