setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'`
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.8k
- Forks
- 2.2k
- Merge medio
- 22 h 28 min
- PR fusionados (30 d)
- 6
Descripción
Problem
The setPersistence method does not work when imported from @angular/fire/auth, leading to a TypeError. However, it works when imported from firebase/auth.
Error
When using the import from @angular/fire/auth, the following error is encountered:
`ERROR TypeError: Class constructor _BrowserLocalPersistence cannot be invoked without 'new'`
Code Example
- Non-functional:
`import { setPersistence, browserLocalPersistence } from '@angular/fire/auth';`
`await setPersistence(this.auth, browserLocalPersistence);`
- Functional:
`import { setPersistence, browserLocalPersistence } from 'firebase/auth';`
`await setPersistence(this.auth, browserLocalPersistence);`
Guía de contribución
Línea de trabajo
Reproduce el fallo usando las importaciones de @angular/fire/auth y compáralo con las importaciones funcionales de firebase/auth mostradas en el issue. Rastrea los puntos de entrada de la autenticación y verifica que setPersistence con browserLocalPersistence funcione mediante @angular/fire/auth sin el TypeError.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, firebase, typescript
- Área
- authentication
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 43/100