angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Docs: Emulator guide missing breaking changes in >7.0

Open jzabinski-dolios opened this issue 3 years ago • 1 comments
trafficstars

How to reproduce these conditions

The upgrade guide for v7 mentions a breaking change: "USE_EMULATOR DI token is now in the form of ['http://localhost:9099']". This change is not documented in the Emulators guide. The Emulators guide still shows: { provide: USE_AUTH_EMULATOR, useValue: environment.useEmulators ? ['localhost', 9099] : undefined },

This is shown under '6.1 Method'. Something should probably be written for v7+.

jzabinski-dolios avatar Apr 06 '22 17:04 jzabinski-dolios

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Apr 06 '22 17:04 google-oss-bot

I've been having trouble with using the emulator for the last few weeks and received this bit of code from the firebase-tools group. I had to wrap the connectAuthEmulators with if (environment.useEmulators) and it works with and without the providers specified above.

imports: [
    provideAuth(() => {
      const auth = getAuth();
      if (environment.useEmulators) {
        connectAuthEmulator(auth, 'http://localhost:5005', { disableWarnings: true });
      }
      return auth;
    }),
    provideFirestore(() => {
      const firestore = getFirestore();
      if (environment.useEmulators) {
        connectFirestoreEmulator(firestore, 'localhost', 5006);
      }
      return firestore;
    }),
 ]

It would be nice to have a definitive guide.

brooksdra avatar Oct 09 '22 22:10 brooksdra

I found the rest of the sample code at https://github.com/angular/angularfire/blob/57d9005d2e0077d3920e66b5cbcaea1fb7f84450/samples/modular/src/app/app.module.ts . It should be copied to the emulators guide under a new section titled "7.0 Method".

danielzgtg avatar Nov 28 '22 16:11 danielzgtg