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
Currently running setPersistence with any Persistence breaks. I was able to work around this by just importing setPersistence from @firebase/auth instead of @angular/fire/auth.
Version info
Angular: 13.1.3
Firebase: 9.6.4
AngularFire: 7.2.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): Node 17.x; OS Windows 11; Browser Chrome;
TypeError: Class constructor BrowserSessionPersistence cannot be invoked without 'new'
at angular-fire.js:206:29
at angular-fire.js:163:45
at ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25457:1)
at ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at NgZone.run (core.mjs:25311:1)
at run (angular-fire.js:163:35)
at new <anonymous> (angular-fire.js:206:16)
at _getInstance (index-bc414788.js:535:16)
I was able to workaround this with import { setPersistence } from '@firebase/auth' only, browserSessionPersistence can be imported from @angular/fire/auth.
Reacted by BenG, Maysara Al Jumaily, Giuseppe, Laszlo, Alessandro Tornesello and zenguzikovskij
Reacted by Maysara Al Jumaily, DaveRicho and zenguzikovskij
Activity
vandres commentedon Jan 26, 2022
This is related with issue #3038
Idomo commentedon Feb 27, 2022
I was able to workaround this with
import { setPersistence } from '@firebase/auth'only,browserSessionPersistencecan be imported from@angular/fire/auth.Sapython commentedon Mar 10, 2022
Check this pull request it has new docs in that I have added how to use persistence correctly #3174
romanhuba commentedon Sep 27, 2022
Settings persistence in this way is correct, the issue is that it does not work if the function is imported from @angular/fire/auth.
@jamesdaniels any ideas?
IvanColucciSW commentedon Sep 1, 2023
Anyone has managed to solve this issue? I'm facing it right now and it's so annoying
TechieWithBeard commentedon Feb 8, 2024
this is the correct format
this.auth.setPersistence(browserLocalPersistence).then(e=>{ ...... .... })mcdalir commentedon May 3, 2024
It worked for me, thanks