# Function "after" not defined use hugo-build

**URL:** <https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785>\
**Category:** support\
**Created:** [February 26, 2016, 2:09am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785 "2016-02-26T02:09:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ysqi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ysqi/32/1066_2.png) [@ysqi](https://discourse.gohugo.io/u/ysqi)\
**Post date:** [February 26, 2016, 2:09am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/1 "2016-02-26T02:09:48Z")

</div>

Get error for [hugo-build](https://github.com/ArjenSchwarz/wercker-step-hugo-build) in wercker . but work well in my computer.

My Hugo Code, detail see [here](https://github.com/ysqi/yushuangqi.com/blob/master/layouts/partials/book/updowncharpter.html#L8)

```auto
{{ $bp := after $nums $bookPages }}

```

Error Log:

```auto
export WERCKER_STEP_ROOT="/pipeline/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba"
export WERCKER_STEP_ID="hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba"
export WERCKER_STEP_OWNER="arjen"
export WERCKER_STEP_NAME="hugo-build"
export WERCKER_REPORT_NUMBERS_FILE="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/artifacts"
export WERCKER_HUGO_BUILD_VERSION="0.15"
export WERCKER_HUGO_BUILD_FORCE_INSTALL="false"
export WERCKER_HUGO_BUILD_PROD_BRANCHES="master"
export WERCKER_HUGO_BUILD_DISABLE_PYGMENTS="false"
export WERCKER_HUGO_BUILD_CONFIG=""
export WERCKER_HUGO_BUILD_FLAGS=""
export WERCKER_HUGO_BUILD_DEV_FLAGS=""
export WERCKER_HUGO_BUILD_THEME=""
export WERCKER_HUGO_BUILD_DEV_BRANCHES=""
source "/pipeline/hugo-build-3d75b3b5-460a-485e-bd78-36b0f2be1fba/run.sh" < /dev/null
ERROR: 2016/02/25 template: partials/book/updowncharpter.html:8: function "after" not defined
ERROR: 2016/02/25 Error while rendering section book: reflect: call of reflect.Value.FieldByName on ptr Value

```

---

<div class="post-metadata">

**Author:** ![ysqi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ysqi/32/1066_2.png) [@ysqi](https://discourse.gohugo.io/u/ysqi)\
**Post date:** [February 27, 2016, 10:49am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/2 "2016-02-27T10:49:58Z")

</div>

How can help me ? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![moorereason](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/moorereason/32/592_2.png) [@moorereason](https://discourse.gohugo.io/u/moorereason)\
**Post date:** [February 29, 2016, 2:08pm UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/3 "2016-02-29T14:08:48Z")

</div>

@ArjenSchwarz, can you help with this?

---

<div class="post-metadata">

**Author:** ![ArjenSchwarz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arjenschwarz/32/188_2.png) [@ArjenSchwarz](https://discourse.gohugo.io/u/ArjenSchwarz)\
**Post date:** [March 1, 2016, 2:11am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/4 "2016-03-01T02:11:01Z")

</div>

@ysqi, sorry I didn’t see your question earlier. Looking at your source code you’ve fixed or worked around the problem now but did you discover what the issue was?

---

<div class="post-metadata">

**Author:** ![ysqi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ysqi/32/1066_2.png) [@ysqi](https://discourse.gohugo.io/u/ysqi)\
**Post date:** [March 4, 2016, 6:11am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/5 "2016-03-04T06:11:24Z")

</div>

hi @ArjenSchwarz, I don’t fiexd and did’t use `after` in hugo-build . change code view [here](https://github.com/ysqi/yushuangqi.com/commit/d8e334fbc9a5b644c96a9afb3b24fd79e8025fe9#diff-9f5e5644e7319d475d8a2f8f195aebb3L8)

---

<div class="post-metadata">

**Author:** ![ArjenSchwarz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arjenschwarz/32/188_2.png) [@ArjenSchwarz](https://discourse.gohugo.io/u/ArjenSchwarz)\
**Post date:** [March 4, 2016, 10:11am UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/6 "2016-03-04T10:11:35Z")

</div>

Hi @ysqi, thanks for pointing out where you made the change. I’ll have a look to see where it breaks and hopefully fix it.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [March 4, 2016, 1:43pm UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/7 "2016-03-04T13:43:52Z")

</div>

The after template func was released in Hugo 0.15. If that doesn’t exist it must mean that you are on \<= Hugo 0.14.

---

<div class="post-metadata">

**Author:** ![ArjenSchwarz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arjenschwarz/32/188_2.png) [@ArjenSchwarz](https://discourse.gohugo.io/u/ArjenSchwarz)\
**Post date:** [March 4, 2016, 10:10pm UTC](https://discourse.gohugo.io/t/function-after-not-defined-use-hugo-build/2785/8 "2016-03-04T22:10:00Z")

</div>

Thanks @bep, that indeed turned out to be the case.

@ysqi, I looked at your wercker file and you are using the `samueldebruyn/hugo-build` docker container for the build. Looking at that container, it was only updated to use Hugo 0.15 5 days ago, so when you tried it it was still using 0.14 which as @bep points out doesn’t support `after`.

As Hugo is already installed on that box, the Wercker step doesn’t try to install the latest version, assuming that you want to use the already installed version. You can override that behaviour by adding `force_install: true` to your wercker.yml file.
