angular / angular/angularfire

[7.2.0] Angular HMR: FirebaseError: Firestore has already been started and persistence can no longer be enabled

Open
#3,135 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

### Version info

**Angular:** 13.2

**Firebase:** 9.6

**AngularFire:** 7.2

### How to reproduce these conditions

**Steps to set up and reproduce**

- serve Angular project with `ng serve --hmr`
- make some change in the application

### Debug output

** Errors in the JavaScript console **

`FirebaseError: Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.`

### Expected behavior

No errors.

### Actual behavior

Project fails to run with the above error.

Might be related to #2655

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by serving an Angular project with `ng serve --hmr` and changing the application. Then trace AngularFire's Firestore initialization and persistence setup; the issue is done when HMR changes no longer produce the FirebaseError.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, firebase, typescript
Domain
database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.