firebase / firebase/firebase-js-sdk

Document references from another DB cause error logs

Open
#8,166 9 comments 1 reaction 1 assignee Claimed by @dconeybe View on GitHub
api: firestore needs-attention question stack:Angular
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

macOS 14.4.1

### Browser Version

Chrome/123.0.6312.124

### Firebase SDK Version

10.11.0

### Firebase SDK Product:

Firestore

### Describe your project's tooling

Angular 17 app

### Describe the problem

When using imported production data in a dev environment with an app using the Firebase emulators, I get the following error in the browser JavaScript console:

`@firebase/firestore: Firestore (10.11.0): Document users/ contains a document reference within a different database (/(default)) which is not supported. It will be treated as a reference in the current database (demo-project/(default)) instead.`

This appears to have no functional impact (I looked at the source Firebase code and the only action taken for this reference check is to log an error.) When loading a page with a long list of documents, this causes my Chrome JavaScript console to grind to a halt and become pretty unresponsive (there are many, many instances of this error log.)

Since this is more informational than an actual error, ideally this log would just be removed and be covered in documentation if necessary. In addition, if there are any tips for importing production data an an emulated environment and having all document references converted appropriately, I'd be happy to learn about it!

There is a comment in the code where the error is logged `// TODO(b/64130202): Somehow support foreign references.` but this bug report is about the error log and not asking for support for foreign references.

### Steps and code to reproduce issue

1. [Export](https://firebase.google.com/docs/firestore/manage-data/export-import#export_all_documents) Firestore data from a production database.
1. [Import](https://firebase.google.com/docs/emulator-suite/install_and_configure#export_and_import_emulator_data) that data when launching an app that uses the emulators with the `--import` flag.
1. In the development environment app that uses the emulator, [query](https://firebase.google.com/docs/firestore/query-data/get-data#get_all_documents_in_a_collection) documents that include a [Reference](https://firebase.google.com/docs/firestore/manage-data/data-types) in the document data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.