Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New timestamp config throwing error on init #33

Closed
tommaitland opened this issue Nov 13, 2018 · 1 comment
Closed

New timestamp config throwing error on init #33

tommaitland opened this issue Nov 13, 2018 · 1 comment

Comments

@tommaitland
Copy link

  • react-firestore version: 0.10.1
  • firebase version: 5.5.8
  • node version: 8
  • npm (or yarn) version: 1.7 yarn

Relevant code or config

import firebase from '@firebase/app';
import '@firebase/firestore';
firebase.initializeApp(firebaseConfig);
<FirestoreProvider firebase={firebase} useTimestampsInSnapshots>

What you did:
It seems like the latest version of the package isn't initialising correctly due to how the timestamp settings are being set.

What happened:
Throwing the following error on load:

Firebase: firebase.firestore() takes either no argument or a Firebase App instance. (app/invalid-app-argument).
image

Suggested solution:
It seems to be caused by this line: https://github.com/green-arrow/react-firestore/blob/master/src/FirestoreProvider.js#L27

Untested, but I think it needs to be replaced with firebase.firestore().settings({ timestampsInSnapshots: this.props.useTimestampsInSnapshots}) before Line 26

@green-arrow
Copy link
Owner

@tommaitland - Thanks for reporting this! It should be fixed in v0.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants