PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

Uncaught Type error in iron-selectable.html #138

Closed arealdeadone closed 7 years ago

arealdeadone commented 8 years ago

Description

I'm using the google-map elements from the GoogleWebComponents and on including the google-map tag the chrome console throws the following error

iron-selectable.html:263 Uncaught TypeError: this.unlisten is not a function_removeListener
 @ iron-selectable.html:263_activateEventChanged 
@ iron-selectable.html:267_observerEffect 
@ polymer.html:1162(anonymous function) 
@ polymer.html:1020_effectEffects 
@ polymer.html:1017_propertySet 
@ polymer.html:1011_applyConfig 
@ polymer.html:1505_afterClientsReady 
@ polymer.html:1497_ready 
@ polymer-mini.html:69_readyClients 
@ polymer-mini.html:76_ready 
@ polymer-mini.html:68_tryReady 
@ polymer-mini.html:59_initFeatures 
@ polymer.html:2777createdCallback @ polymer-micro.html:109

My code Including the google-map component

<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="apple-touch-icon" href="apple-touch-icon.png">
        <!-- Place favicon.ico in the root directory -->

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <script src="js/vendor/modernizr-2.8.3.min.js"></script>
        <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
        <link rel="import" href="bower_components/google-map/google-map.html">
    </head>
    <body>
        <google-map></google-map>
    </body>
</html>

Code Causing the error

_removeListener: function(eventName) {
      this.unlisten(this, eventName, '_activateHandler');
    },
rafaelsilverioit commented 7 years ago

I'm having the same problem. I've just installed Polymer and google-map component with bower and this error is thrown when I try to use google-map.

Stack trace:

Uncaught TypeError: this.unlisten is not a function(…) - iron-selectable.html:263 

_removeListener @ iron-selectable.html:263
_activateEventChanged @ iron-selectable.html:267
_observerEffect @ polymer.html:1162
(anonymous function) @ polymer.html:1020
_effectEffects @ polymer.html:1017
_propertySet @ polymer.html:1011
_applyConfig @ polymer.html:1505
_afterClientsReady @ polymer.html:1497
_ready @ polymer-mini.html:69
_readyClients @ polymer-mini.html:76
_ready @ polymer-mini.html:68
_tryReady @ polymer-mini.html:59
_initFeatures @ polymer.html:2777
createdCallback @ polymer-micro.html:109
rafaelsilverioit commented 7 years ago

The problem seems to be with the version of Polymer being used, in my case I was using the version 1.0.0.

Based on the pull request #36, the unlisten functionality was implemented on Polymer version 1.0.4 and the google-map component is built within Polymer 1.2.3, so after upgrading to the latest version everything worked just fine.

Would it be possible for you to upgrade your version and test it again?