node-firestore-import-export icon indicating copy to clipboard operation
node-firestore-import-export copied to clipboard

Can not import data to the emulator

Open pascalbe-dev opened this issue 1 year ago • 2 comments

When running an import for the local emulator, the data is not really imported to the firestore emulator.

Steps to reproduce the behavior

  • start the firebase emulator with a demo project ID (firebase emulators:start --project demo-my-project --config some-folder/firebase.json) (a firebase.json which includes the activated firestore emulator on port 8080 is present in "some-folder")
  • setting the FIRESTORE_EMULATOR_HOST environment variable to localhost:8080
  • running a import command, e.g.: firestore-import -y -b users.json -n users

Expected behavior

  • the data gets imported into the database (this is how it works with actual firebase projects)

Actual behavior

  • I get an error message about a missing GOOGLE_APPLICATION_CREDENTIALS variable

  • when I now point this env variable to the service account key for a different environment, the import command works (success message), but data is still not imported in the emulator.

Final thoughts

So, basically, I see two problems:

  • why is the service account key required for the emulator?
  • why is the data not imported even with a service account key?

pascalbe-dev avatar Sep 21 '22 15:09 pascalbe-dev