You attempted to overwrite the built-in helper "array"
Michal Bryxí
Posted on January 1, 2021
The problem
Recently I updated one of my EmberJS projects (v3.15.1...v3.23.0). And I got quite an unexpected error saying:
Error occurred while rendering:
- While rendering:
application
authenticated
authenticated.admin
authenticated.admin.items
tabs
authenticated.admin.items.stock
form-radio
form-field
Uncaught Error: Assertion Failed: You attempted to
overwrite the built-in helper "array" which is
not allowed. Please rename the helper.
The search
OK, I was pretty sure I did not write the helper myself. So since I knew that form-field
and form-radio
are from the amazing frontile addon, I tried to look there. I found the usage of array helper, but no definition.
So it either came from an addon or is native to respective Ember version. Since I did not know how to check the former, I went with the latter. And it turned out that Ember has native template array helper since version 3.8.0. So not much of a help here.
Luckily I remembered that since the beginning of the project I was using ember-composable-helpers addon that back in the days used to have also array template helper. So after a little bit of digging I found a PR with title: [Breaking Change] Refactor helpers for Octane (Ember 3.13+), which landed in v3.0.0 of ember-composable-helpers.
So next stop package.json
files in my project and indeed I have found a pre v3.0.0 version:
"ember-composable-helpers": "^2.2.0",
Solution
tl;dr: If you bump into a "Uncaught Error: Assertion Failed: You attempted to overwrite the built-in helper "array" which is not allowed. Please rename the helper." error in your ember app/addon, chances are that you just need to run following command to make it work again:
ember install ember-composable-helpers
Photo by Sarah Kilian on Unsplash
Posted on January 1, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.