react-query-firebase hooks do not work in a Next.js app until AFTER a vanilla Firebase API is made.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 28/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- firebase, javascript, next.js, react, typescript
Direzione di ricerca
Inizia dal file app.js, dove vengono configurati queryClient e l’inizializzazione di Firebase, quindi segui useFirestoreQueryData e la chiamata all’API vanilla di Firebase che fa sì che gli hook inizino a funzionare. Riproduci l’errore al caricamento iniziale o all’aggiornamento di una pagina nell’app Next.js e confronta il comportamento prima e dopo quella chiamata all’API. Il lavoro è completato quando l’hook funziona senza la chiamata dummy oppure viene documentata l’inizializzazione richiesta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi,
Great package so far but I'm having an issue where I get the following error: "FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore".
I am building a Next.js app (but no SSR or SSG). I am currently refactoring our Firebase API (vanilla JS) with react-query-firebase hooks.
When a page is loaded (or refreshed), I see the above error message. At first, I thought it was something specific with Next.js (and it could very well be). I then realized that using a react-query-firebase hook such as 'useFirestoreQueryData' anywhere in the app provides the above error message right away. However, if I use one of our vanilla Firebase API calls BEFORE using a react-query-firebase hook, everything works just fine.
I believe that react-query-firebase is NOT reading the Firebase initializeApp code (which is set up according to both this library's documentation and the official Firebase documentation). To confirm this, I have made a simple "dummy" Firebase API call in our app.js file (the file where we set up queryClient). Doing this "hack" fixes the above issue right away.
Please advise on what to do. Perhaps it's not a bug and i'm simply missing something from your documentation. Also, still could be a Next.js specific issue, however, we have built other Next.js apps with react-query (non-firebase, graphQL) and that worked perfectly fine too.
Thanks!
- Lingua principale
- TypeScript
- Stelle
- 462
- Fork
- 70
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di invertase/tanstack-query-firebase
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
invertase/tanstack-query-firebase#202 · 5 commenti · 2 reazioni ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
invertase/tanstack-query-firebase#131 · 1 commento ·
-
react-query-firebase
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
react-query-firebase
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
-
Enabled option errorApertareact-query-firebase
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
invertase/tanstack-query-firebase#90 · 1 commento ·
Tutte le issue di invertase/tanstack-query-firebase
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
openedx/frontend-app-authoring#3274 ·
I maintainer di solito rispondono entro 1 giorno
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
area/documentation status/need-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
google-gemini/gemini-cli#29548 ·
I maintainer di solito rispondono entro 1 giorno
-
sdk-typescript vector-store
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
mem0ai/mem0#7495 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno