Vuefire: firestore subscription throwing error on change

Created on 15 Nov 2020  Â·  6Comments  Â·  Source: vuejs/vuefire

Reproduction

Steps to reproduce the behavior

Open page

Expected behavior

show the spectators loaded from firestore.

Actual behavior

It throws an error:
Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at extractRefs (vuefire.esm.js?0ff2:186)
at Object.added (vuefire.esm.js?0ff2:354)
at eval (vuefire.esm.js?0ff2:412)
at Array.forEach ()
at Array.eval (vuefire.esm.js?0ff2:411)
at next (index.esm.js?c6c5:16645)
at eval (index.esm.js?c6c5:13404)

Most helpful comment

I moved back to 7. For firestore and it worked

On Sun, Nov 15, 2020, 9:29 AM Anas KHABALI notifications@github.com wrote:

i'm getting the same issue with the latest versions:

"vuefire": "^2.2.4"
"firebase": "^8.0.2",

when fetching a collection

vuefire.esm.js?0ff2:186 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at extractRefs (vuefire.esm.js?0ff2:186)
at Object.added (vuefire.esm.js?0ff2:354)
at eval (vuefire.esm.js?0ff2:412)
at Array.forEach ()
at Array.eval (vuefire.esm.js?0ff2:411)
at next (index.esm.js?c6c5:16645)
at eval (index.esm.js?c6c5:13404)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/vuejs/vuefire/issues/944#issuecomment-727606212, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAADZEFPOVRXFBTOT5QYGETSQAFY7ANCNFSM4TV5Q33A
.

All 6 comments

In bindCollection(_a, extraOptions)

I am seeing that _a.newIndex == -1

Which means that subs ends up undefined.

var change = {
    added: function (_a) {
        var newIndex = _a.newIndex, doc = _a.doc;
        arraySubs.splice(newIndex, 0, Object.create(null));
        var subs = arraySubs[newIndex];
        var _b = extractRefs(options.serialize(doc), undefined, subs), data = _b[0], refs = _b[1];
        ops.add(array, newIndex, data);
        subscribeToRefs(options, array, newIndex, subs, refs, ops, 0, resolve.bind(null, doc));
    },

image

It seems like it's a problem with the latest firebase.js

Here's a repro:
https://jsfiddle.net/tsqvg9hf/2/

i'm getting the same issue with the latest versions:

"vuefire": "^2.2.4"
"firebase": "^8.0.2",

when fetching a collection
```
vuefire.esm.js?0ff2:186 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at extractRefs (vuefire.esm.js?0ff2:186)
at Object.added (vuefire.esm.js?0ff2:354)
at eval (vuefire.esm.js?0ff2:412)
at Array.forEach ()
at Array.eval (vuefire.esm.js?0ff2:411)
at next (index.esm.js?c6c5:16645)
at eval (index.esm.js?c6c5:13404)
````

I moved back to 7. For firestore and it worked

On Sun, Nov 15, 2020, 9:29 AM Anas KHABALI notifications@github.com wrote:

i'm getting the same issue with the latest versions:

"vuefire": "^2.2.4"
"firebase": "^8.0.2",

when fetching a collection

vuefire.esm.js?0ff2:186 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at extractRefs (vuefire.esm.js?0ff2:186)
at Object.added (vuefire.esm.js?0ff2:354)
at eval (vuefire.esm.js?0ff2:412)
at Array.forEach ()
at Array.eval (vuefire.esm.js?0ff2:411)
at next (index.esm.js?c6c5:16645)
at eval (index.esm.js?c6c5:13404)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/vuejs/vuefire/issues/944#issuecomment-727606212, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAADZEFPOVRXFBTOT5QYGETSQAFY7ANCNFSM4TV5Q33A
.

https://github.com/vuejs/vuefire/pull/940

I haven't been able to look at this yet. Help on reviewing what has broken, if a new major version of vuefire should be released, and reviewing the PR would be appreciated

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amesas picture amesas  Â·  5Comments

calirails picture calirails  Â·  5Comments

Pixelime picture Pixelime  Â·  5Comments

ConnerFrancis picture ConnerFrancis  Â·  6Comments

franciscolourenco picture franciscolourenco  Â·  7Comments