riot+compiler.min.js:2 Uncaught TypeError: Cannot create property 'admin-product' on string 'Subscription' #1803

Closed
pmtolk opened this Issue May 19, 2016 · 4 comments

Projects

None yet

2 participants

@pmtolk
pmtolk commented May 19, 2016 edited

Help us to manage our issues by answering the following:

  1. Describe your issue:
 <div each={results}>
     {console.log(this)}
     <admin-product product={this}></admin-product>
</div>

{this} being 1 of the results as an object has a tags in it with the string Subscription

  1. Can you reproduce the issue?

yes
Post the link using one of our bug report templates:

  1. On which browser/OS does the issue appear?
    chrome only, firefox works
  2. Which version of Riot does it affect?
    2.4.x
  3. How would you tag this issue?
    Bug
    • Question
    • Bug
    • Discussion
    • Feature request
    • Tip
    • Enhancement
    • Performance
@pmtolk pmtolk changed the title from firefox good, chrome error riot+compiler.min.js:2 Uncaught TypeError: Cannot create property 'admin-product' on string 'Subscription' to riot+compiler.min.js:2 Uncaught TypeError: Cannot create property 'admin-product' on string 'Subscription' May 19, 2016
@GianlucaGuarini
Member

Thanks, can you please reproduce this issue in an example ( like recommended in our issues template )?

@pmtolk
pmtolk commented May 19, 2016

You can see the difference in output in firefox working, and chrome not working

http://plnkr.co/edit/7wSknlym8yq8682UKs2J?p=preview

@GianlucaGuarini
Member

@pmtolk you are using tags in your data object that is a reserved word.. avoid it http://plnkr.co/edit/oZrsGAdT8eiQSzwEEXpX?p=preview
we should fix this problem showing a console warn or something similar

@pmtolk
pmtolk commented May 19, 2016

I would agree with you except that the json data from 3rd party vendor api often has a tag attribute within the data and it is working in firefox.

My workaround is this currently


self.results = _.map(response.products, function(product) {
                        delete product.tags;
                        return product;
});
@GianlucaGuarini GianlucaGuarini added a commit that closed this issue May 22, 2016
@GianlucaGuarini GianlucaGuarini closes #1803 70913ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment