Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Conversation

@Scarygami
Copy link
Contributor

I've run into an issue when using FirestoreElement in the same element that has firebase-app.

Accessing firebase.firestore() in the constructor happened before firebase-app had a chance to initialize the app, resulting in an error.

A workaround would have been to create a separate element with the FirestoreElement mixin to load the data and retrieve the data from there instead of using a Firestore property directly, but the error was easy enough to fix this way.

@Westbrook Westbrook mentioned this pull request Feb 23, 2018
@stemuk
Copy link

stemuk commented May 28, 2018

Could this issue maybe get fixed? I recently ran into the same error @Scarygami described and the fix seems to be working.

@Scarygami
Copy link
Contributor Author

Scarygami commented May 28, 2018

I've rebased this PR against the current firestore branch.
This is the version I'm currently using without problems.

(Also gets rids of the "The behavior for Date objects stored in Firestore is going to change
AND YOUR APP MAY BREAK." warning)

Also moved the super.connectedCallback back to the end. This move only solved issues in the original version of this mixin, which has significantly changed since then.

@stemuk
Copy link

stemuk commented May 29, 2018

I tried out your updated polymerfire firestore branch and for some reason I am still getting the no-app error, even though I have the firebase-app element imported and included in the element.
Does maybe the PRPL pattern of the Polymer Starter Kit tamper with the firebase-app initialization?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants