angular / angular/angularfire

setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'`

Aberta
#3,550 3 comentários 5 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
7.8k
Forks
2.2k
Merge médio
22h 28min
PRs com merge (30d)
6

Descrição

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);`

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Reproduza a falha usando os imports de @angular/fire/auth e compare-a com os imports funcionais de firebase/auth mostrados na issue. Rastreie os pontos de entrada da autenticação e verifique se setPersistence com browserLocalPersistence funciona por meio de @angular/fire/auth sem o TypeError.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
angular, firebase, typescript
Domínio
authentication
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
43/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.