Skip to content

Commit 86ea407

Browse files
Fix instance deletion in the Console build (#4328)
The console build doesn't have FirebaseApp and fails the delete if this.app is accessed.
1 parent a6c6cff commit 86ea407

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/firestore/src/api/database.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ export class Firestore
277277
}
278278

279279
terminate(): Promise<void> {
280-
(this.app as _FirebaseApp)._removeServiceInstance('firestore');
281-
(this.app as _FirebaseApp)._removeServiceInstance('firestore-exp');
280+
if (this._appCompat) {
281+
(this._appCompat as _FirebaseApp)._removeServiceInstance('firestore');
282+
(this._appCompat as _FirebaseApp)._removeServiceInstance('firestore-exp');
283+
}
282284
return this._delegate._delete();
283285
}
284286

0 commit comments

Comments
 (0)