You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'` #3550
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
changed the title [-]Issue Report: setPersistence in AngularFire[/-][+] setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'`[/+]on Jun 20, 2024
Trying to write tests with the Firebase Emulator it seems that sign in can persist across tests. I hoped that setting setPersistence(auth, inMemoryPersistence) would help, but it does not seem to.
However I still experienced the issue mentioned above and the work around still at least executed the test suite.
Activity
google-oss-bot commentedon Jun 20, 2024
This issue does not seem to follow the issue template. Make sure you provide all the required information.
[-]Issue Report: setPersistence in AngularFire[/-][+] setPersistence in AngularFire _BrowserLocalPersistence cannot be invoked without 'new'`[/+]Steve-from-Memphis commentedon Dec 21, 2024
Ran into the same issue and am following the same work around as described in this ticket.
BTW, here is the stackoverflow.com question from 3 years ago with the exact same problem and work around: https://stackoverflow.com/questions/69292778/angularfire-auth-persistence-cannot-be-invoked-without-new
rgant commentedon Jan 28, 2025
Trying to write tests with the Firebase Emulator it seems that sign in can persist across tests. I hoped that setting
setPersistence(auth, inMemoryPersistence)would help, but it does not seem to.However I still experienced the issue mentioned above and the work around still at least executed the test suite.
Same issue as #3131