is not a function #2154

markgarrigan opened this Issue Dec 12, 2016 · 3 comments


None yet

3 participants


Help us to manage our issues by answering the following:

  1. Describe your issue:
    I'm looping through an array of objects. I do this all the time. However, currently I'm running into an issue where I receive an error in the console that says " is not a function". It seems to be caused when the object in the array has a key of "parent".

  2. Can you reproduce the issue?

  1. On which browser/OS does the issue appear?
    Chrome/OS X

  2. Which version of Riot does it affect?

  3. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@GianlucaGuarini GianlucaGuarini added the bug label Dec 13, 2016
markgarrigan commented Dec 13, 2016 edited


I see there was already discussion about this. I understand renaming my key is a work around, however, when working with 3rd party api and JSON this doesn't seem like the best solution. For now, the renaming of the key is not a big deal. But, hopefully, there's a way to fix it in the core.

rsbondi commented Dec 13, 2016
          <tr each={ item in bad_items }>
              { item.description }

Thanks @rsbondi! I see that does help. However, is that the fix or just another workaround? Seems like documentation may be needed?? Since it may be confusing for some people accessing the item in an event handler.

<p each={ item in bad_items } onclick={ parent.remove }>{ item.description }</p>

remove(ev) {
  var item = ev.item.item

Maybe that's ok or just common sense? I'm not sure?

Regardless, thanks again for the help!

@GianlucaGuarini GianlucaGuarini added a commit that closed this issue Dec 18, 2016
@GianlucaGuarini GianlucaGuarini closes #2154 0a414bb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment