FirebaseUI-Angular icon indicating copy to clipboard operation
FirebaseUI-Angular copied to clipboard

Error when entering localhost as address in providers

Open Metsuryu opened this issue 3 years ago • 3 comments

When setting up the providers, the readme.md shows this:

providers: [ { provide: USE_AUTH_EMULATOR, useValue: !environment.production ? ['localhost', 9099] : undefined }, ],

But this gives an error:

ERROR FirebaseError: Firebase: Error (auth/invalid-emulator-scheme).

Because it checks for this assertion:

_assert(/^https?:\/\//.test(url), authInternal, "invalid-emulator-scheme" /* INVALID_EMULATOR_SCHEME */);

If instead of localhost I try to use http://127.0.0.1, it doesn't thorw the error anymore, but it doesn't work, showing "A network error has occurred"

and in console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1/identitytoolkit.googleapis.com/v1/accounts:createAuthUri?key=.... (Reason: CORS request did not succeed). Status code: (null).

Metsuryu avatar May 31 '22 17:05 Metsuryu

Hello @Metsuryu, sorry for the late response.

Is this still an issue?

RaphaelJenni avatar Jun 19 '22 21:06 RaphaelJenni

Hi @RaphaelJenni, I stopped using the package, so I'm not sure, but probably.

Metsuryu avatar Jun 19 '22 21:06 Metsuryu

I am pulling my hair trying to get this thing to work, and i do encounter this issue: image

mbimbij avatar May 18 '24 14:05 mbimbij