简体   繁体   中英

Expecting a function in instanceof check, but got undefined

I am getting this weird error while working on a Polymer component and that is not it the biggest problem is that chrome somehow crashes when I try to debug the Polymer library. I am at my wits end trying to solve this bug.

The premise is simple I have a component with property data which is an array and it's changed by another component by setting it like someComponent.set('data', []); . The set happens multiple times and the value set on data changes, at one point when the value is being set the error in title is thrown. Following is the stack trace, since I can't reproduce the bug in a jsbin.

Polymer.dom @ polymer-mini.html:1040 Polymer.Base._addFeature.serializeValueToAttribute @ polymer.html:3416 Polymer.Base._addFeature.reflectPropertyToAttribute @ polymer-micro.html:593 Polymer.Base.extend._reflectEffect @ polymer.html:1607 Polymer.Bind._modelApi._effectEffects @ polymer.html:1461 Polymer.Bind._modelApi._propertySetter @ polymer.html:1445 setter @ polymer.html:1524 Polymer.Base._addFeature.set @ polymer.html:2103 Polymer.updateTargets @ t-demo-atom.html:234

Maybe this would work:

-in the child, create a function to set data to an incoming value

-in the father, just call that function instead of setting the data value yourself

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM