Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to local firestore emulator: ERROR FirebaseError: false for 'get' @ L14 #2564

Closed
jonathan-chin opened this issue Aug 5, 2020 · 1 comment

Comments

@jonathan-chin
Copy link

hi all, I'm trying to connect my client code to the locally running firestore emulator. I've implemented the fix from #2183 by using the provider in app.module.ts

providers: [
        [...]
        {
            provide: FIRESTORE_SETTINGS,
            useValue: environment.emulator ? {
                host: 'localhost:8080',
                ssl: false
            } : {}
        }
    ]

however, my client then throws a weird error:

ERROR FirebaseError: 
false for 'get' @ L14
    at new n (http://localhost:8100/vendor.js:116516:23)
    at t.ni (http://localhost:8100/vendor.js:119662:16)
    at t.pi (http://localhost:8100/vendor.js:119821:195)
    at n.onMessage (http://localhost:8100/vendor.js:126333:33)
    at http://localhost:8100/vendor.js:126286:26
    at http://localhost:8100/vendor.js:126317:37
    at http://localhost:8100/vendor.js:124224:31
    at ZoneDelegate.invoke (http://localhost:8100/polyfills.js:3470:30)
    at Zone.run (http://localhost:8100/polyfills.js:3229:47)
    at http://localhost:8100/polyfills.js:3963:40

the error seems to be generated when I actually try to interact with the firestore database from my client:

this.angularFirestore
  .collection('users')
  .doc(user.uid)
  .snapshotChanges()
  .subscribe((snapshot) => {
    // do stuff
  });

I am running the emulator suite no problem and have already successfully directed my function calls to it (which also writes to the firestore emulator, so I know that is working). any insights?

if I run the same exact client code without the provider (ie running it against the real firestore server), it works (except, of course, the data/contents on the real server doesn't match the ones on the emulated server).

Version info

Angular: 9.1.6

Firebase: 7.15.0

AngularFire: 6.0.0

Other (e.g. Ionic/Cordova, Node, browser, operating system):
Ionic 5.0.0

@jonathan-chin
Copy link
Author

I've figured this out. when trying to a similar firestore call (.get() instead of .snapshotChanges().subscribe()), I get a very similar error but it adds [code=permission-denied]'. it's still the same enigmatic false for 'get' @ L14` otherwise.

this ultimately ended up being a firestore rules issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant