Closed Nicien closed 8 months ago
Hello @Nicien. Could you provide some reproduction steps as well as a simple code sample so I may check this out?
@exaby73 Good news ! I'm able to reproduce the error in a dedicated minimal project with a minimal amount of code :)
Here the steps:
$ npm create vite@latest β Project name: β¦ firestore-bug-test β Select a framework: βΊ React β Select a variant: βΊ TypeScript + SWC
$ firebase init
with Firestore + Emulators
Replace App.tsx
with the content of this file
$ firebase emulators:start
$ yarn run dev
And the error is there: {"error":{"code":500,"message":"Internal","status":"INTERNAL"}}
:)
@exaby73 Tell me if there is a way to help you further.
@Nicien I am unable to access the file you linked. I'm getting blocked for some reason. Could you paste the file in a comment here instead? You can use a collapsable section for the code so it's not a huge comment
Hi @Nicien, we have found the root cause of this issue and it should be fixed in the next release. Please let me know if the issue is resolved. Will be looking out for an update!
@exaby73 Done. Thx for teaching me how to use collapsable sections :)
@harshyyy21 Cool. thank you ! I'm looking forward to the next release to give you feedback. (I can't use the lastest firebase from git because an obscure typescript error is preventing me from doing sotsc --build tsconfig.publish.json
).
feedback as requested: the bug disappears with the version13.5.1
of firebase-tools :)
Thank you !
Hello, The firestore emulator starts returning "internal error" (500, see below) for just one of my firebase project for no obvious reason: I didn't touch the code of the client.
The project is relatively simple, it's just a react app which use
firebase/firestore/lite
andfirebase/auth
, nothing fancy, no special configuration, no hacks and no problems with the deployed app.So I suppose that the bug has been introduced in a recent version of firebase-tools.
Here the results after testing with different versions:
13.3.0
(using cloud-firestore-emulator-v1.18.2.jar): β13.3.1
(using cloud-firestore-emulator-v1.19.1.jar) : π₯13.4.0
(using cloud-firestore-emulator-v1.19.1.jar) : π₯13.4.1
(using cloud-firestore-emulator-v1.19.2.jar) : π₯The last working version of firebase-tools in my situation is
13.3.0
Interresting fact: The firestore Emulator UI works fine ! (http://127.0.0.1:4000/firestore)
Environment info
firebase-tools version:
13.4.1
(using cloud-firestore-emulator-v1.19.2.jar)Platform:
macOS
Client: react using npm package
firebase 10.8.1
Steps to reproduce
1) Create an new project
$ npm create vite@latest β Project name: β¦ firestore-bug-test β Select a framework: βΊ React β Select a variant: βΊ TypeScript + SWC
2) Init firebase
$ firebase init
with Firestore + Emulators
3) Add basic code
Replace `App.tsx` with this
``` import { useEffect, useState } from "react"; import "./App.css"; import { initializeApp } from "firebase/app"; import { getFirestore, connectFirestoreEmulator, } from "firebase/firestore/lite"; import { getDocs, collection, query, orderBy, limit, } from "firebase/firestore/lite"; const connectEmulators = true; const firebaseConfig = { projectId: "dummy-project-id", }; // Initialize Firebase const app = initializeApp(firebaseConfig); const firestore = getFirestore(app); // this.analytics = getAnalytics(this.app); if (connectEmulators) { // connectAuthEmulator(this.auth, "http://localhost:9099"); connectFirestoreEmulator(firestore, "localhost", 8080); } async function getPerfumes() { const perfumeRecipesCollection = collection(firestore, "perfume-recipes"); const perfumes = await getDocs( query(perfumeRecipesCollection, orderBy("created", "desc"), limit(100)) ); return perfumes.docs.map((doc) => doc.data()); } function App() { const [perfumes, setPerfumes] = useStateTest playground for issue #6853
Run the emulator
And the error is there:
{"error":{"code":500,"message":"Internal","status":"INTERNAL"}}
:)Expected behavior
Firestore emulator returns the content of the local database as usual.
Actual behavior
The request:
POST http://localhost:8080/v1/projects/fragrance-b6af8/databases/(default)/documents:runQuery
returns500
Response:
Content of
firestore-debug.log
:zip of full firebase logs logs.zip
By the way, I like firebase: especially hosting, firebase/auth and firestore :) I hope google will invest on it.