firebase-element icon indicating copy to clipboard operation
firebase-element copied to clipboard

Uncaught TypeError: Cannot read property '__firebaseKey__' of undefined

Open jenyckee opened this issue 10 years ago • 4 comments
trafficstars

I have a collection of objects in a firebase db

<template>
    <firebase-collection
      location="https://incandescent-inferno-8405.firebaseio.com/objects/-JubQT-WrBaVlSeuKJhO"
      data="{{object}}"
    </firebase-collection>

    <paper-input value="{{object.attribute::input}}"></paper-input>
</template>

When I start typing in the input field I get

Uncaught TypeError: Cannot read property '__firebaseKey__' of undefined

Is this a bug or am I doing something wrong?

jenyckee avatar Jul 19 '15 19:07 jenyckee

Hi, this is a symptom of a bug that was addressed a few days ago. Can you confirm that you have the latest version of the element (v1.0.2)? Thanks!

cdata avatar Jul 21 '15 16:07 cdata

I updated to the latest version but still got the same error. However this works

    <firebase-collection
      location="https://incandescent-inferno-8405.firebaseio.com/objects"
      data="{{objects}}"></firebase-collection>
    <template is="dom-repeat" items="{{objects}}" as="object">
      <paper-input value="{{object.attribute}}"></paper-input>
    </template>

jenyckee avatar Jul 22 '15 09:07 jenyckee

Thanks for the examples. I will take a look.

cdata avatar Jul 22 '15 17:07 cdata

@jenyckee I believe it's as I answered here - http://stackoverflow.com/questions/31504447/firebase-polymer-two-way-binding-uncaught-typeerror-cannot-read-property-f/31545356#31545356 You are mixing up collections & documents/arrays of objects & single objects. In your first example above you are trying to bind your collection of objects to a single paper-input, doesn't work/make sense. In the 2nd example you are binding a single object from your collection to a single paper-input value, that does make sense & works.

sfeast avatar Jul 23 '15 00:07 sfeast