# Concat error when bundling js files from theme

**URL:** <https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465>\
**Category:** support\
**Created:** [May 12, 2020, 9:45pm UTC](https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465 "2020-05-12T21:45:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brokenindexfinger](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@brokenindexfinger](https://discourse.gohugo.io/u/brokenindexfinger)\
**Post date:** [May 12, 2020, 9:45pm UTC](https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465/1 "2020-05-12T21:45:58Z")

</div>

I’m attempting to bundle some JS assets, following the example from the docs here: [https://gohugo.io/hugo-pipes/bundling/](https://gohugo.io/hugo-pipes/bundling/)

I’m getting the following error: `error calling Concat: slice []interface {} not supported in concat`. Here’s the relevant code in my partial.

```auto
{{ $jquery := resources.Get "js/lib/jquery.min.js" }}
{{ $anime := resources.Get "js/lib/anime.min.js" }}
{{ if eq .Site.Params.includeBootstrapJs true }} }}
  {{ $bootstrap := resources.Get "js/lib/bootstrap.bundle.min.js" }}
  {{ $js := slice $jquery $bootstrap $anime | resources.Concat "js/bundle.js" }}
{{ else }}
  {{ $js := slice $jquery $anime | resources.Concat "js/bundle.js" }}
{{ end }}
<script src="{{ "js/bundle.js" | relURL }}"></script>

```

The assets in question are located in `/themes/hugo-base-theme/static/js/lib/`.

I’ve had a look at [this issue](https://discourse.gohugo.io/t/solved-hugo-v0-55-6-error-calling-ressources-concat/19197) and not able to understand how the solution there would apply to my use case.

Relevant changes are in [this diff](https://github.com/Hyperobjekt/seda-site/commit/e982052fa7e4792f778f6233161187199260669f).

---

<div class="post-metadata">

**Author:** ![brokenindexfinger](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@brokenindexfinger](https://discourse.gohugo.io/u/brokenindexfinger)\
**Post date:** [May 12, 2020, 10:02pm UTC](https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465/2 "2020-05-12T22:02:37Z")

</div>

I’m able to get it working, but only by moving the JS files from the theme to `./assets`. Is there any way around that? We have several hugo projects and we like to simply move the relevant theme files when starting a new project.

---

<div class="post-metadata">

**Author:** ![brokenindexfinger](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@brokenindexfinger](https://discourse.gohugo.io/u/brokenindexfinger)\
**Post date:** [May 12, 2020, 10:38pm UTC](https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465/3 "2020-05-12T22:38:48Z")

</div>

It looks like the site setting `assetDir` will work when pointed to a dir in the theme, despite some commentary in the git repo that (maybe) suggests otherwise…

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 14, 2020, 10:38pm UTC](https://discourse.gohugo.io/t/concat-error-when-bundling-js-files-from-theme/25465/4 "2020-05-14T22:38:49Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
