Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.03k stars 2.02k forks source link

Uncaught TypeError: Cannot read property '1' of undefined at Object.runBindingEffect #4831

Closed bennypowers closed 7 years ago

bennypowers commented 7 years ago

Description

Error thrown when instantiating Polymer2.0 class element in my app. When Object.runBindingEffect is called, nodeList is undefined.

property-effects.html:552 Uncaught TypeError: Cannot read property '1' of undefined
    at Object.runBindingEffect [as fn] (property-effects.html:552)
    at runEffectsForProperty (property-effects.html:160)
    at runEffects (property-effects.html:126)
    at HTMLElement._propagatePropertyChanges (property-effects.html:1676)
    at HTMLElement._propertiesChanged (property-effects.html:1641)
    at HTMLElement._flushProperties (property-accessors.html:549)
    at HTMLElement.__enableOrFlushClients (property-effects.html:1548)
    at HTMLElement._readyClients (property-effects.html:1562)
    at HTMLElement._readyClients (element-mixin.html:653)
    at HTMLElement._flushClients (property-effects.html:1517)
runBindingEffect @ property-effects.html:552
runEffectsForProperty @ property-effects.html:160
runEffects @ property-effects.html:126
_propagatePropertyChanges @ property-effects.html:1676
_propertiesChanged @ property-effects.html:1641
_flushProperties @ property-accessors.html:549
__enableOrFlushClients @ property-effects.html:1548
_readyClients @ property-effects.html:1562
_readyClients @ element-mixin.html:653
_flushClients @ property-effects.html:1517
_propertiesChanged @ property-effects.html:1643
_flushProperties @ property-accessors.html:549
ready @ property-effects.html:1605
ready @ element-mixin.html:633
ready @ legacy-element-mixin.html:176
ready @ class.html:215
ready @ class.html:215
ready @ class.html:215
ready @ class.html:215
ready @ class.html:215
ready @ class.html:215
ready @ class.html:215
_enableProperties @ property-accessors.html:531
connectedCallback @ element-mixin.html:614
connectedCallback @ legacy-element-mixin.html:90

Live Demo

http://jsbin.com/luhaxab/1/edit

Steps to Reproduce

Expected Results

Actual Results

Browsers Affected

Versions

TimvdLippe commented 7 years ago

Thanks for the issue. Please see CONTRIBUTING.md for guidelines on filing issues. Please fill out as many fields in the issue template as possible, and be sure to include a live reproduction so that the team can debug or understand your issue. You can start from this jsBin template as a starting point and link it in the issue template under "Live Demo".

Feel free to file a new issue following these instructions. Thank you!

kisira commented 6 years ago

@bennypowers how did you solve this?

mapb1990 commented 6 years ago

+1

piot commented 6 years ago

+1

gino-m commented 6 years ago

In my case, this was caused by overriding ready() without calling the superclass impl. This fix was to call super.ready() before custom logic, like so:

  ready() {
    super.ready();
    // ... do stuff ...
  }