question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useFirestoreCollection crash straight away on usage

See original GitHub issue

Version info

React: 0.0.0-experimental-ea6ed3dbb

Firebase: 7.9

ReactFire: v2.0.0-rc.1

Other (e.g. Node, browser, operating system) (if applicable): Node 10.15.1

Test case

I want to load and then listen to changes to a collection in Firestore.

import React from 'react';
import { useFirestore, useFirestoreCollection } from 'reactfire';

function SimpleTest() {
   const firestore = useFirestore;
   const ref = firestore().collection('productionTemplates');
   const productionTemplates = useFirestoreCollection(ref);

   return <h1>Hello World</h1>;
}

Steps to reproduce

Add code above to any project

Expected behavior

Expect to get a list from my selected collection back (no output in code above, but console logging it to inspect. Doesnt matter since it crashes)

Actual behavior

Crash, pointing to missing canonicalId() on undefined. Reactfire seems to expect _query to exist on the firestore query object, but it does not on inspection. In my environment it did have an object called “EP” that had the canonicalId function on it, tried to rebuild the npm package, switching from _query to EP and it loaded without error now.

reactfire

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jhuleattcommented, Feb 24, 2020

Looks like this was fixed in 7.9.1

StackBlitz that shows it working now: https://stackblitz.com/fork/reactfire-issue-216

0reactions
jhuleattcommented, Mar 16, 2020

Cool, thanks for confirming. I’m going to close this - if someone else runs into a similar error on 2.0.2+, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash due to low free RAM availabl… | Apple Developer Forums
In our app, we use AWS s3 services to upload videos. I found out that while performing this action of upload, some of...
Read more >
How to use the reactfire.useFirestoreCollection function in ...
To help you get started, we've selected a few reactfire.useFirestoreCollection examples, based on popular ways it is used in public projects.
Read more >
Crashlytics troubleshooting and FAQ - Firebase
This page provides troubleshooting help and answers to frequently-asked questions about using Crashlytics. If you can't find what you're looking for or need ......
Read more >
ReactFire - BestofReactjs
Convenient components for common use cases - Only want to render a component if a user is signed in? ... useFirestoreCollection crash straight...
Read more >
App crashing right away after deploy from Github Actions
As Bertrand said, there was something wrong with the mongodb connection, so I just found that the variable MONGODB_URL was not set, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found