Skip to content

connect to emulator inconsistencies #7678

@marcusx2

Description

@marcusx2

Operating System

macOS

Browser Version

Safari 16.5.2

Firebase SDK Version

10.4.0

Firebase SDK Product:

Firestore

Describe your project's tooling

index.html with source tag. Just javascript.

Describe the problem

Connecting to the different emulators have different syntax. It works one way to connect to the Auth emulator, another to connect to the Firestore emulator. I didn't check the others. But here's an example

connectAuthEmulator(auth, "http://127.0.0.1:9099");
connectFirestoreEmulator(db, "127.0.0.1", 8080);

The reason this is bad is because, apart from the fact that you have to use a different syntax for no reason and make it unintuitive, it's very easy to mess up and get non-helpful errors on the console. For example, if I try to connect to the Firestore emulator like this

connectFirestoreEmulator(db, "http://127.0.0.1", 8080);

I get the following error after a couple of seconds "Firestore (10.4.0): WebChannelConnection""RPC 'Write' stream 0x1d36fd2c transport errored:". It's not actually an error, but any Firestore operation won't work.

All I did was add the http:// like I do for the auth emulator, and it stopped working.

Please, normalize the method signature to connect to the emulator across all packages.

Steps and code to reproduce issue

Already explained.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions