angular / angular/angularfire

Auth is not a function when using compatibility in production build

未關閉
#3,221 20 則留言 14 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
7.8k
分支
2.2k
平均合併
22 小時 28 分鐘
30 天內合併 PR
6

描述

### 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

貢獻指南

開啟貢獻指南

研究方向

重現 issue 中描述的 production build,從 main.ts:16 和 angular-fire-compat-auth.js:59 處的失敗開始。比較 development 和 production bundle,以找出為什麼缺少 compatibility auth API。完成的標準是 authentication 在 production build 和 development 中都能成功初始化。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, firebase, typescript
領域
authentication, build-system, frontend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。