-
-
Notifications
You must be signed in to change notification settings - Fork 343
Closed as not planned
Labels
Description
Steps to reproduce the behavior
- Go to Cloud Firestore and create a collection 'books'
- Add a 'book' document with a field containing a dot (.) and make it a reference to somewhere else.
2.1. An example would be this field:T.HANKS => (reference) /authors/T.HANKS
2.2. Firebase allows you to have dots inside document and field names - Bind this book document in your code
return bindFirestoreRef('author', db.collection('authors').doc('T.HANKS'))
Expected behavior
A clear and concise description of what you expected to happen.
Actual behavior
Vuefire doesn't like that, and dies here:
/**
* Walks a path inside an object
* walkGet({ a: { b: true }}), 'a.b') -> true
* @param obj
* @param path
*/
function walkGet(obj, path) {
// TODO: development warning when target[key] does not exist
return path.split('.').reduce(function (target, key) { return target[key]; }, obj);
}Additional information
The stacktrace is something like this:
Uncaught TypeError: Cannot read property 'HANKS' of undefined
at eval (vuexfire.esm.js?5a83:18)
at Array.reduce (<anonymous>)
at walkGet (vuexfire.esm.js?5a83:18)
at updateDataFromDocumentSnapshot (vuexfire.esm.js?5a83:271)
at Array.eval (vuexfire.esm.js?5a83:280)
at next (index.cjs.js?92d4:15375)
at eval (index.cjs.js?92d4:13446)
Notice the property it errs with is "HANKS" but the key is "T.HANKS".