vue-firestore icon indicating copy to clipboard operation
vue-firestore copied to clipboard

When you are binded to a document that doesn't exist yet, a console error is thrown.

Open MgenGlder opened this issue 4 years ago • 1 comments

🐛 Bug Report

When I run my vue-firestore powered app and connect it to a document inside of a collection that doesn't exist (yet) I get the error.

Uncaught (in promise) Error: This document (currentBallot) is not exist or permission denied.

Expected Bevavior

There should be an option to suppress/allow this happenstance, because in my case my document won't exist until it is created. This is expected as part of the design of the app, as the app is checking to see if the result of the query returns a valid Firestore object or not. If not, there is logic that checks against empty or a length of 0 for that document, and it behaves accordingly. Screen Shot 2020-08-08 at 5 33 27 PM Looks like the grammar is also incorrect on this one too.

This document <document name> is not exist or permission denied.

should be

The document <document name> doesn't exist or permission was denied

MgenGlder avatar Aug 08 '20 21:08 MgenGlder

https://github.com/gdg-tangier/vue-firestore/blob/387af6b01e9cc4fd6b355088a888f6502c54ce40/src/vue-firestore.js#L133

Seems to be the culprit. I think the error throwing here should be optional- or maybe exposed as a development-level warning. Wouldn't want that kind of error showing up in a prod environment. Going to play with it a see if I can't come up with a solution. Curious to know your thoughts as well.

MgenGlder avatar Aug 08 '20 21:08 MgenGlder