failed-precondition

what this Firebase error means

How it shows up

FirebaseError: [code=failed-precondition]: The query requires an index. You can create it here: https://console.firebase.google.com/...

What it means

Firestore rejected the operation because the system is not in the state the operation needs. A common case is a query that needs a composite index that does not exist yet.

The usual cause in an AI-built app

AI-generated queries often combine a where filter with an orderBy or range filter on another field. That needs a composite index, which Firestore does not create for you.

Check this first

Open the link in the full error message, which fills in the missing index in the Firebase console, and check its fields before you create it.

More Firebase codes