angular / angular/angularfire

Auth is not a function when using compatibility in production build

Offen
#3,221 20 Kommentare 14 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
7.8k
Forks
2.2k
Ø Merge
22 Std. 28 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Version info

**Angular:** 13.3.0

**Firebase:** ^9.8.1

**AngularFire:** 7.3.0

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

### How to reproduce these conditions

**Steps to set up and reproduce**

When a production build is served, we have an error with Firebase app.auth() is not found. This does not happen with a development build.

We are using the compatibility version of Angular Fire.

### Debug output

** Errors in the JavaScript console **

> main.ts:16 TypeError: Bt.auth is not a function
> at angular-fire-compat-auth.js:59:51
> at rr.invoke (zone.js:409:30)
> at rr.run (zone.js:169:47)
> at value (core.mjs:25486:28)
> at angular-fire-compat-auth.js:59:23
> at tn (angular-fire-compat.js:147:29)
> at we (angular-fire-compat-auth.js:58:116)
> at new Ue (angular-fire-compat-firestore.js:513:13)
> at Object.$e.ɵfac [as factory] (angular-fire-compat-firestore.js:584:1)
> at value (core.mjs:11477:35)

### Expected behavior

Build runs on both development and production

### Actual behavior

Build runs only in development

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere den im Issue beschriebenen Production-Build, beginnend bei main.ts:16 und dem Fehler in angular-fire-compat-auth.js:59. Vergleiche die Development- und Production-Bundles, um zu ermitteln, warum die Compatibility-Auth-API fehlt. Erledigt bedeutet, dass die Authentifizierung sowohl in einem Production-Build als auch in der Entwicklung erfolgreich initialisiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, firebase, typescript
Bereich
authentication, build-system, frontend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.